principal_components_result: Easy Access to Principal Component Analysis Results
Description
principal_components_result Provides easy access to principal
component analysis results
Usage
principal_components_result(data, results = 2)
Arguments
data
list output from principal_components
results
principal component analysis results to extract. Can use either
results name or number (i.e. pca_loadings or 2):
pca_sdev
pca_loadings (default)
pca_rotated
pca_center
pca_scale
Value
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).
# NOT RUN {# An efficient means for getting principal component analysis resultsx <- matrix(rnorm(200 * 3), ncol = 10)
principal_components(x) %>%
principal_components_result(pca_loadings)
# }