Description Usage Arguments Value See Also Examples
principal_components_result
Provides easy access to principal
component analysis results
1 | principal_components_result(data, results = 2)
|
data |
list output from |
results |
principal component analysis results to extract. Can use either results name or number (i.e. pca_loadings or 2):
|
Returns one of the selected results:
pca_sdev
: the standard deviations of the principal components (i.e., the square roots of the eigenvalues of the correlation matrix, though the calculation is actually done with the singular values of the data matrix).
pca_loadings
: the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors).
pca_rotated
: if retx
is TRUE
the value of the rotated data (the centred (and scaled if requested) data multiplied by the rotation matrix) is returned. Hence, cov(x)
is the diagonal matrix diag(sdev^2)
.
pca_center
: the centering used
pca_scale
: whether scaling was used
principal_components
for computing the principal components results
1 2 3 4 5 | # An efficient means for getting principal component analysis results
x <- matrix(rnorm(200 * 3), ncol = 10)
principal_components(x) %>%
principal_components_result(pca_loadings)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.