expVar | R Documentation |
S3 function expVar to extract explained variance from prcomp and PCAScoreMatrix objects
expVar(x, choices)
## S3 method for class 'prcomp'
expVar(x, choices)
## S3 method for class 'PCAScoreMatrix'
expVar(x, choices)
x |
A |
choices |
Either missing, or an integer vector of indices, indicating which PCs should be returned. |
A numeric vector of variance explained
expVar(prcomp)
: Extract explained variance from a prcomp object
expVar(PCAScoreMatrix)
: Extract explained variance from a PCAScoreMatrix object
prcomp
: Extract
explained variance from a prcomp object
PCAScoreMatrix
: Extract explained variance from a
PCAScoreMatrix object
myMat <- matrix(rnorm(100), ncol=10)
myPrcomp <- prcomp(myMat)
myPcaScoreMatrix <- pcaScores(myPrcomp, choices=NULL)
expVar(myPrcomp)
expVar(myPcaScoreMatrix)
expVar(myPrcomp, 1:5)
expVar(myPcaScoreMatrix, 1:5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.