minus_polygon_list: Subtract one or more polygons

minus_polygon_listR Documentation

Subtract one or more polygons

Description

Subtract one or more polygons

Usage

minus_polygon_list(polygon_list, new_name = NULL, ...)

Arguments

polygon_list

list object that contains one or more polygons.

new_name

character string with optional new name for the output polygon.

...

additional arguments are ignored.

Details

This function takes a list of polygons and iteratively calls polyclip::polyclip(A, B, op="minus") to produce a union across one or more polygons, which otherwise only works with two polygons.

Value

object list of polygons

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(), nudge_polygon_coords(), nudge_polygon_list(), plot_polygon_list(), polygon_areas(), 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()

Examples

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

circle_minus <- minus_polygon_list(polygon_list);
circle_colors <- colorjam::rainbowJam(length(polygon_list), alpha=0.5);
plot_polygon_list(polygon_list, col=circle_colors, main="minus")
plot_polygon_list(circle_minus, col="#FFDD0088", border="red", lwd=3, add=TRUE)

circle_minus2 <- minus_polygon_list(polygon_list[c(2,1,3)]);
plot_polygon_list(circle_minus2, col="#FFDD0088", border="blue", lwd=3, add=TRUE)

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