npts | R Documentation |
count the number of points/vertices/nodes of sf objects
npts(x, by_feature = FALSE)
x |
an sf/sfc object |
by_feature |
count total number of vertices (FALSE) of for each feature (TRUE). |
currently only works for *POINTS, *LINES and *POLYGONS (not GEOMETRYCOLLECTION).
npts(franconia)
npts(franconia, by_feature = TRUE)
npts(sf::st_geometry(franconia[1, ])) # first polygon
npts(breweries) # is the same as
nrow(breweries)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.