Returns a vector of the same length as the number of lines, with the number of vertices per line or polygon.

n_vertices(l)

Arguments

l

A SpatialLines or SpatalPolygons object

Details

See https://gis.stackexchange.com/questions/58147/ for more information.

See also

Examples

n_vertices(routes_fast)
#> [1] 2 53 97 37 41 73 104 53 2 44 59 79 97 121 98 65 2 64 84 #> [20] 114 131 44 59 55 2 22 52 64 46 79 75 22 2 27 65 70 87 105 #> [39] 52 27 2 46 114 126 130 69 65 46 2
n_vertices(routes_fast_sf)
#> [1] 2 53 97 37 41 73 104 53 2 44 59 79 97 121 98 65 2 64 84 #> [20] 114 131 44 59 55 2 22 52 64 46 79 75 22 2 27 65 70 87 105 #> [39] 52 27 2 46 114 126 130 69 65 46 2