Simple question: how to extract the number of vertices in each polygon in R?
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), FUN=length)[,2]
x@data$nverts <- n.verts