# NOT RUN {
set.seed(1)
# Simulate 10x5 MVN data matrix
X=matrix(rnorm(50), nrow=10)
# Perform PCA
prcomp.out = prcomp(X)
# Get rank 2 reconstruction
reconstruct(X, prcomp.out$rotation[,1:2])
# }
Run the code above in your browser using DataLab