Principal Component Analysis Question - Why do the Loadings Not Change As You Change the Number of PCs? I am trying to teach myself how to use R Shiny and as a part of this dashboard I'm constructing, I have a section where a user performs principal component analysis and can use a slider to choose the number of PCs to include.
Here is a snapshot of my code:
PCA=preProcess(to_be_PCAed, method = "pca", pcaComp = input$num)
rots=round(PCA$rotation,6)

The user will use the slider to choose from 20 PCs down to just 2.  Whenever I display the matrix of loadings, the individual loadings for each variable do not change within a PC when I add or subtract another PC.  Is that how Principal Component analysis should work?  What am I missing here?  My original thought was that the loadings determined which PC a variable would be classified under and I would think that the variables would be grouped together differently based on the number of principal components.  So, I was expecting as I add or subtract a PC, the loadings would change.
Can someone explain why this is not the case?
 A: You have two separate questions here: (1) Running Shiny, and (2) interpreting PCA.
Your Shiny app works fine.
And your PCA is correct.
I'm guessing that you come from the social sciences, like me, where principal components analysis is usually followed by rotation of the components. The default rotation is VariMax but there are several others methods. Then the technique is called Factor Analysis.
I used to help my students to understand PCA with this simple analogy:
Imagine a ship taken into harbour pulled by two, or more, tugboats, each pulling with the same strength, but in slightly different directions. Draw it on a piece of paper. Now, in what direction and with what strength is the ship heading? It's the resolution of the pull of the different tugboats. That is the first Principal Component. In two dimensions, x & y, we can defie the effort of the tugboats in terms of vectors along xy. After removing the first Principal Component there is still some pull in the xy plane. That's the second Principal Component. Now, if we move into three dimensions, and change our analogy to a Startreck tractor beam, then we might have a third PC. Logically, the first PC will always be larger than all folowing PCs.
