getPcaVars | R Documentation |
Given a PCA object created with prcomp, this function computes the percent of variance explained by each of the principal components.
getPcaVars(pca, digits = 3)
pca |
An object created with prcomp. |
digits |
The number of significant digits to round to. |
A vector with the percent of variance explained for each of the principal components in decreasing order.
Andrew E Jaffe
pca <- prcomp(USArrests)
getPcaVars(pca)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.