encircle: Encircle points

View source: R/encircle.R

encircleR Documentation

Encircle points

Description

Draw a polygons around a certains set of points.

Usage

encircle(x, y = NULL, nb.pt = 20, off.set = 1, ...)

Arguments

x

the x coordinates of a set of points. Alternatively, a single argument x can be provided.

y

the y coordinates of a set of points.

nb.pt

the number of points to be generated around each coordinates.

off.set

the y coordinates of a set of points.

...

further arguments to be passed to graphics::polygon() function.

Details

The technique employed is straightforward: for each point, a circle of radius of off.setmade ofnb.pt' points, then a convex is drawn around the coordinates using grDevices::chull().

Examples

coords <- cbind(runif(10), runif(10))
plot0(coords)
points(coords, bg='grey25', pch=21)
encircle(coords, border='#7b11a1', lwd=2)

KevCaz/graphicsutils documentation built on Sept. 16, 2022, 10:05 a.m.