polygon_areas | R Documentation |
Polygon area for simple or list of polygons
polygon_areas(x, y = NULL, simplify = FALSE, verbose = FALSE, ...)
x |
|
y |
|
simplify |
|
verbose |
|
... |
additional arguments are ignored. |
numeric
vector with polygon area for each individual polygon
in the input x
,y
.
When x
is a list
that contains "x"
and "y"
elements, those
elements are used.
When x
and y
both contain a list
of numeric
vectors, each
vector is considered coordinates of a polygon, and the area is returned
for each polygon.
When x
and y
are numeric
vectors, it is considered a single
polygon, and thus one area is returned.
Other venndir polygons:
bbox_polygon_list()
,
eulerr_to_polygon_list()
,
get_largest_polygon_list()
,
get_venn_polygon_shapes()
,
intersect_polygon_list()
,
labelr_polygon_list()
,
minus_polygon_list()
,
nudge_polygon_coords()
,
nudge_polygon_list()
,
plot_polygon_list()
,
polygon_circles()
,
polygon_ellipses()
,
polygon_list_labelr()
,
polygon_list_to_xy_list()
,
rescale_polygon_list()
,
simple_ellipse()
,
union_polygon_list()
,
xy_list_to_polygon_list()
D <- list(
x=c(-3, 3, 3, 0, -3),
y=c(-3, -3, 1.5, 4, 1.5))
polygon_areas(D)
E <- list(
x=c(-3, 3, 3, -3),
y=c(-3, -3, 3, 3))
polygon_areas(E)
DElist <- list(
x=list(
D=c(-3, 3, 3, 0, -3),
E=c(-3, 3, 3, -3)),
y=list(
D=c(-3, -3, 1.5, 4, 1.5),
E=c(-3, -3, 3, 3)))
polygon_areas(DElist)
# list of polygons
poly_list <- list(D=D, E=E)
polygon_areas(poly_list)
# list of nested polygons
polygon_areas(list(DE=poly_list, D=D, E=E))
polygon_areas(list(DE=poly_list, D=D, E=E), simplify=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.