Perform principal components analysis.
stats_pca(rm_mean = TRUE, rm_sd = FALSE, x, sdev, rot = NULL)
rm_mean, rm_sd | Should the data be centered/scaled first? Operations occur in-place. |
---|---|
x | Input matrix. The input values are overwritten. |
sdev | The standard deviations for the principal components. |
rot | The pca loadings. If |
suppressMessages(library(fmlr)) x = cpumat(3, 2) x$fill_linspace(1, 6) s = cpuvec() stats_pca(TRUE, TRUE, x, s) s$info()#> # cpuvec 2 type=ds$print()#> 1.4142 0.0000 #>