pca: Principal Components Analysis (PCA)

View source: R/pca.R

pcaR Documentation

Principal Components Analysis (PCA)

Description

Compute the directions of maximal variance in a data matrix using the Singular Value Decomposition (SVD).

Usage

pca(
  X,
  ncomp = min(dim(X)),
  preproc = center(),
  method = c("fast", "base", "irlba", "propack", "rsvd", "svds"),
  ...
)

Arguments

X

The data matrix.

ncomp

The number of requested components to estimate (default is the minimum dimension of the data matrix).

preproc

The pre-processing function to apply to the data matrix (default is centering).

method

The SVD method to use, passed to svd_wrapper (default is "fast").

...

Extra arguments to send to svd_wrapper.

Value

A bi_projector object containing the PCA results.

See Also

svd_wrapper for details on SVD methods.

Examples

data(iris)
X <- as.matrix(iris[, 1:4])
res <- pca(X, ncomp = 4)
tres <- truncate(res, 3)

bbuchsbaum/multivarious documentation built on May 15, 2024, 7:25 a.m.