centroids | R Documentation |
Get the centroids of polygons or lines, or centroid-like points that are guaranteed to be inside the polygons or on the lines.
## S4 method for signature 'SpatVector'
centroids(x, inside=FALSE)
x |
SpatVector |
inside |
logical. If |
SpatVector of points
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
x <- centroids(v)
y <- centroids(v, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.