pca | R Documentation |
Compute the directions of maximal variance in a data matrix using the Singular Value Decomposition (SVD).
pca(
X,
ncomp = min(dim(X)),
preproc = center(),
method = c("fast", "base", "irlba", "propack", "rsvd", "svds"),
...
)
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 |
... |
Extra arguments to send to |
A bi_projector
object containing the PCA results.
svd_wrapper
for details on SVD methods.
data(iris)
X <- as.matrix(iris[, 1:4])
res <- pca(X, ncomp = 4)
tres <- truncate(res, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.