Skip to contents

Calculates the area for a (non-crossing) shape.

Usage

coo_area(coo)

Arguments

coo

a matrix of (x; y) coordinates.

Value

numeric, the area.

Note

Using area.poly in gpc package is a good idea, but their licence impedes Momocs to rely on it. but here is the function to do it, once gpc is loaded: area.poly(as(coo, 'gpc.poly'))

Examples

coo_area(bot[1])
#> [1] 234515
# for the distribution of the area of the bottles dataset
hist(sapply(bot$coo, coo_area), breaks=10)