0
votes

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?

1

1 Answers

2
votes

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