circle | R Documentation |
Find a smooth convex shape that encircles the points given as input using either Bezier curves or semicircles around each corner.
circle(data, r = 0.5, s = 8, method = "b", closed = FALSE)
data |
Either a matrix or a data frame with two real-valued columns or a complex-valued vector. |
r |
The distance from the data to the encircling shape. Must be non-negative. Defaults to 0.5. |
s |
A smoothness parameter. Must be greater than 2. For bezier curves, this equals to the number of points around each point on the convex hull and for method = "c", scaled to yield similar results. Defaults to 8. |
method |
Either "b" for a quadratic Bezier curve or "c" for a semicircle around each point of the hull. Defaults to "b". |
closed |
If |
A matrix with points of the encircling shape as rows.
# A minimal example
data <- data.frame(x = rnorm(5), y = rnorm(5))
circ <- circle(data, closed = TRUE)
plot(circ, type = "l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.