R/pca.R

Defines functions `pca`

`pca` <- function(X, scale = FALSE, ...) {
  if (inherits(X, "formula")) {
    stop("Argument 'X' was supplied a formula, which is not supported by 'pca()'",
    call. = FALSE)
  }
  ord <- rda(X = X, scale = scale, ...)
  # change the call to be from pca()
  ord$call <- match.call()
  class(ord) <- append(class(ord), "vegan_pca", after = 0)
  ord
}
vegandevs/vegan documentation built on April 13, 2025, 6:54 p.m.