encircle | R Documentation |
Draw a polygons around a certains set of points.
encircle(x, y = NULL, nb.pt = 20, off.set = 1, ...)
x |
the x coordinates of a set of points. Alternatively, a
single argument |
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 |
The technique employed is straightforward: for each point, a circle of
radius of off.setmade of
nb.pt' points, then a convex is drawn around
the coordinates using grDevices::chull()
.
coords <- cbind(runif(10), runif(10)) plot0(coords) points(coords, bg='grey25', pch=21) encircle(coords, border='#7b11a1', lwd=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.