Description Usage Arguments Value References See Also Examples
Apply PCA to a matrix or poplin object. For the data without missing values, PCA is performed via singular value decomposition. Otherwise, PCA is performed using the non-linear iterative partial least squares (NIPALS) algorithm via the nipalsPca function from the pcaMethods package. NIPALS PCA can handle a small amount of missing values.
1 2 3 4 5 | ## S4 method for signature 'matrix'
reduce_pca(x, ncomp = 2, center = TRUE, scale = FALSE, ...)
## S4 method for signature 'poplin'
reduce_pca(x, xin, xout, ncomp = 2, center = TRUE, scale = FALSE, ...)
|
x |
A matrix or poplin object. |
ncomp |
Output dimensionality. |
center |
Logical indicating mean-centering prior to PCA. |
scale |
Logical indicating unit variance scaling prior to PCA. |
... |
Additional arguments passed to nipalsPca. |
xin |
Character specifying the name of data to retrieve from |
xout |
character specifying the name of data to store in |
A poplin.pca or poplin object with the same number of
rows as ncol(x)
containing the dimension reduction result.
poplin.pca is a matrix containing custom attributes used to summarize and
visualize the PCA result.
Wold, H. (1966). Estimation of principal components and related models by iterative least squares. In P. R. Krishnajah (Ed.), Multivariate analysis (pp. 391-420). NewYork: Academic Press.
Other data reduction methods:
poplin_reduce()
,
reduce_plsda()
,
reduce_tsne()
1 2 3 4 5 6 7 8 9 10 | data(faahko_poplin)
## poplin object
out <- reduce_pca(faahko_poplin, xin = "knn_cyclic", xout = "pca")
summary(poplin_reduced(out, "pca"))
## matrix
m <- poplin_data(faahko_poplin, "knn_cyclic")
out <- reduce_pca(m, ncomp = 3)
summary(out)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.