R – How to show all the sample principal component plots in R

pcar

I noticed something in R, say pc is the result of applying PCA to a data matrix and
pc$x is my sample principal component matrix .

When try plot(pc$x), it will only plot the first principal component (pc1) against the second (pc2), but I actually have more than 2 principal components. How do I show all of them?

Best Answer

All combinations in a single plot:

pairs(pc$x)

To select a specific combination just use:

plot(pc$x[, c(1,3)])  # e.g. pc1 and pc3
Related Topic