How to understand 'prcomp' result?
After running below code, we get prcomp result 'res.pca'.
It include '$ sdev'/'$ rotation'/'$ center'/'$ scale $ x',how to understand all of them. Thanks.
library(factoextra)
data("decathlon2")
decathlon.active <- decathlon2[1:23, 1:10]
res.pca <- prcomp(decathlon.active,scales=TRUE)
str(res.pca)
sdevis the s.d of the principal components and also the squre roots of the eigenvalues of the covariance matrix.rotationis a matrix whose columns contain the eigenvectors, the principal components in the original coordinate system.In PCA, as you set option
scales = TRUE, it scale datadecathlon.active, and thosecenterandscaleare the centering and scaling used to scale the data.Finally,
xis the matrix of rotated data, also means the principal components of your data.