> I am trying to use PrinComp to do principle component analysis. I
> would like to know how to set the number of principle components.
I assume you mean the function princomp (case _does_ matter in R) in
package stats (which is loaded by default). This function has no way
of specifying how many components to calculate; it always gives you
all components. You have to select the components you want
afterwards. See help(princomp) for details. E.g.
X <- some matrix
pc <- princomp(X)
pc$scores[,1:4] # The four first score vectors
pc$loadings[,1:4] # The four first loadings
(The loadings can also be extracted with loadings(pc)[,1:4] .)
--
Bj?rn-Helge Mevik