polygon_list_to_xy_list: Convert polygon list of x,y coordinate into a list by x and y

polygon_list_to_xy_listR Documentation

Convert polygon list of x,y coordinate into a list by x and y

Description

Convert polygon list of x,y coordinate into a list by x and y

Usage

polygon_list_to_xy_list(x, flatten = FALSE, ...)

Arguments

x

list of polygons

  • each polygon should contain a list with elements "x" and "y".

  • each polygon can contain multiple component polygons as a nested list, in which case this function is called iteratively so that the component "x" and "y" are returned as equivalent nested list objects.

  • In all cases, names(output$x) and names(output$y) should equal names(x).

flatten

logical indicating whether all polygons should be flattened to the same level, without nested polygons.

...

additional arguments are ignored.

Details

Input is a list of polygons, where each polygon contains a list with elements "x" and "y". Output is a list of "x" and "y" split by each polygon.

Value

list with elements "x" and "y" which each contain a list with length length(x).

See Also

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_areas(), polygon_circles(), polygon_ellipses(), polygon_list_labelr(), rescale_polygon_list(), simple_ellipse(), union_polygon_list(), xy_list_to_polygon_list()

Examples

counts <- c(A=1, B=2, `A&B`=3)
x <- eulerr::euler(counts)
polygon_list <- eulerr_to_polygon_list(x)
jamba::ssdim(polygon_list)
jamba::ssdim(polygon_list_to_xy_list(polygon_list))

jamba::ssdim(polygon_list_to_xy_list(list(AB=polygon_list)))


jmw86069/venndir documentation built on June 15, 2024, 1:52 p.m.