R/centroids.R

Defines functions centroids

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)
}

Try the R2BayesX package in your browser

Any scripts or data that you put into this service are public.

R2BayesX documentation built on Oct. 20, 2023, 3:01 p.m.