Created
October 7, 2019 19:02
-
-
Save monogenea/d9a37c2fd7b9a33c876e2960bdb92c3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate scaled 4*5 matrix with random std normal samples | |
set.seed(101) | |
mat <- scale(matrix(rnorm(20), 4, 5)) | |
dimnames(mat) <- list(paste("Sample", 1:4), paste("Var", 1:5)) | |
# Perform PCA | |
myPCA <- prcomp(mat, scale. = F, center = F) | |
myPCA$rotation # loadings | |
myPCA$x # scores |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment