prcomp | R Documentation |
This method allows computation of a truncated principal components analysis of matter_mat
and sparse_mat
matrices using the implicitly restarted Lanczos method from the “irlba” package.
## S4 method for signature 'matter_mat'
prcomp(x, k = 3L, retx = TRUE, center = TRUE, scale. = FALSE, ...)
## S4 method for signature 'sparse_mat'
prcomp(x, k = 3L, retx = TRUE, center = TRUE, scale. = FALSE, ...)
prcomp_lanczos(x, k = 3L, retx = TRUE,
center = TRUE, scale. = FALSE, transpose = FALSE,
verbose = NA, BPPARAM = bpparam(), ...)
x |
A |
k |
The number of principal components to return, must be less than |
retx |
A logical value indicating whether the rotated variables should be returned. |
center |
A logical value indicating whether the variables should be shifted to be zero-centered, or a centering vector of length equal to the number of columns of |
scale. |
A logical value indicating whether the variables should be scaled to have unit variance, or a scaling vector of length equal to the number of columns of |
transpose |
A logical value indicating whether |
verbose |
Should progress messages be printed? |
... |
Additional options passed to |
BPPARAM |
An optional instance of |
An object of class ‘prcomp’. See ?prcomp
for details.
The built-in predict()
method (from the stats package) is not compatible with the argument transpose=TRUE
.
Kylie A. Bemis
irlba
prcomp_irlba
register(SerialParam())
set.seed(1)
x <- matter_mat(rnorm(1000), nrow=100, ncol=10)
prcomp(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.