st_numpoints.Rd
Count the number of points in a geometry
st_numpoints(.geom) st_npoints(.geom)
.geom | A geometry object. |
---|
Other make: st_makeline
,
st_makepoint
, st_multi
library(tibble) library(dplyr) tibble(x = 1:2, y = 3:4) %>% mutate(geom = st_makepoint(x, y), n = st_npoints(geom)) %>% summarise(line = st_makeline(geom), n = st_numpoints(line))#> # A tibble: 1 x 2 #> line n #> <LINESTRING> <int> #> 1 (1 3, 2 4) 2