Description Usage Arguments Details Value Examples
View source: R/getLoadingsFromPCA.R
As we have a lot of packages with a lot of PCA functions available, we need to establish an interface between the PCA functions and Variable Selection process. For this, we have two functions: getLoadingsFromPCA and getScoresFromPCA. They let us to get the load and score, respectively, from any PCA function of any package. If you are interested in a PCA function of another package not used in the SUPCAVS package, you can rewrite these functions for your needs.
1 2 3 |
x |
This is a PCA object. |
The PCA object can come from prcomp or princomp functions. It can also come from pcaMethods library.
The returned value is:
getLoadingsFromPCA
: returns a matrix of loads from PCA.
getScoresFromPCA
: returns a score matrix (data set transformed by PCA transformations).
getEigenvalueFromPCA
: returns a eigenvalue vector.
1 2 3 4 5 6 7 8 | x = matrix(rnorm(100), 20,5,
dimnames=list(NULL, paste('X', 1:5, sep='')))
pc = prcomp(x)
pcaLoadMatrix = getLoadingsFromPCA(pc)
pcaScoreMatrix = getScoresFromPCA(pc)
pcaEigenvalues = getEigenvaluesFromPCA(pc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.