Skip to contents

Scales the PCA decomposition eigenvectors (rotation output of prcomp) by the square root of corresponding eigenvalues (sdev output of prcomp).

Usage

get_loadings(obj_prcomp)

Arguments

obj_prcomp

prcomp object

Value

Matrix of PCA loadings

See also

Examples

data(iris)
PCA_iris <- Rubrary::run_PCA(t(iris[,c(1:4)]))
#> ** Cumulative var. exp. >= 80% at PC 1 (92.5%)

Rubrary::get_loadings(PCA_iris)
#>                     PC1         PC2         PC3         PC4
#> Sepal.Length  0.7431080 -0.32344628  0.16277024  0.04870686
#> Sepal.Width  -0.1738010 -0.35968937 -0.16721151 -0.04936083
#> Petal.Length  1.7615451  0.08540619 -0.02132015 -0.07408051
#> Petal.Width   0.7367389  0.03718318 -0.15264701  0.11635429