centroids <- function(map)
{
n <- length(map)
cp <- matrix(0, n, 2L)
for(i in 1L:n) {
cp[i,] <- centroidpos(na.omit(map[[i]]))
}
rownames(cp) <- names(map)
colnames(cp) <- c("x", "y")
return(cp)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.