Learn R Programming

secr (version 3.0.1)

polyarea:

Description

Area of a single closed polygon (simple x-y coordinate input) or of multiple polygons, possibly with holes.

Usage

polyarea(xy, ha = TRUE)

Arguments

xy
dataframe or list with components `x' and `y', or a SpatialPolygons or SpatialPolygonsDataFrame object from package sp
ha
logical if TRUE output is converted from square metres to hectares

Value

A scalar.

Details

For SpatialPolygons or SpatialPolygonsDataFrame objects, the packages sp and rgeos are used.

See Also

buffer.contour

Examples

Run this code
polyarea(make.grid(hollow = TRUE))

Run the code above in your browser using DataLab