principal_components_result: Easy Access to Principal Component Analysis Results

Description Usage Arguments Value See Also Examples

View source: R/pca.R

Description

principal_components_result Provides easy access to principal component analysis results

Usage

1

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):

  1. pca_sdev

  2. pca_loadings (default)

  3. pca_rotated

  4. pca_center

  5. pca_scale

Value

Returns one of the selected results:

  1. 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).

  2. pca_loadings: the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors).

  3. 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).

  4. pca_center: the centering used

  5. pca_scale: whether scaling was used

See Also

principal_components for computing the principal components results

Examples

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)

AFIT-R/anomalyDetection documentation built on Oct. 14, 2019, 5:24 p.m.