Hi, What you probably want is nrow(st_coordinates(st_centroid(sentrau))) which is equal to now(sentrau)
nrow(st_coordinates(sentrau)) is equal to sum(sapply(1:nrow(sentrau), FUN = function(i) nrow(st_coordinates(sentrau[i, ])))) as sentrau is MULTIPOLYGON Hope this helps. > On 11 May 2024, at 13:47, Aymard Loïc KWEKEU KWEKEU > <kwekeuaymardl...@gmail.com> wrote: > >> hos <- geo[!sf::st_is_empty(geo), ] > >> santrau <-cbind(hos, st_coordinates(st_centroid(hos$geometry))) > >> sontrau <- subset(santrau, select=c(1:40)) > >> sentrau <- na.omit(sontrau) > [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo