Make SpatialPolygons circles

sp_circles(xcenter, ycenter, setnames = NULL, radius = 1, n = 60, ...)

Arguments

xcenter, ycenter

numeric vector that defines the x and y coordinate position of the center of each circle.

setnames

vector that contains names for each circle, stored in the sp::SpatialPolygons object as the polygon name. When setnames is NULL then integer index positions are used.

radius

numeric vector that defines the radius of each circle. This vector is recycled to length(xcenter).

n

integer value indicating the number of subdivisions to use in the circle.

...

additional arguments are ignored.

Value

object sp::SpatialPolygons with a number of circles defined by length(xcenter).

Details

This function creates one or more circles as sp::SpatialPolygons objects.

Examples

sp <- sp_circles(c(3, 2), c(2, 3))
plot(sp, col=c("#FF000077", "#FFDD0077"));
axis(1, las=2); axis(2, las=2);
points(x=c(3, 2), y=c(2, 3), pch=c("1", "2"), add=TRUE);