2
votes
1answer
126 views

Extract number of vertices in each polygon in R

Simple question: how best to do this? I've found one way that works, but this is very slow (when x is a SpatialPolygonsDataFrame): y <- fortify(x) n.verts <- aggregate(y, by=list(y$id), ...