R/getPCA.R

#' Get PCA Data
#'
#' @param data Data structure from geomorph or created by readTem()
#' @return A table summarizing the percent variation explained by each PC and the set of PC scores
#' @examples
#' faces$pca <- getPCA(faces)
#' @export

getPCA <- function(data) {
  message("Running PCA");
  coords <- getCoords(data)
  pca <- prcomp(geomorph::two.d.array(coords), center = TRUE, scale. = FALSE)
  return(pca)
}
debruine/frlgmm documentation built on May 15, 2019, 1:55 a.m.