Re: [R] Extracting columns from a class

2011-03-19 Thread Thomas Levine
Hi, Here is the prcomp output. tom=prcomp(matrix(rnorm(25),5,5)) R functions often output lists. To see what's in this one, run names(tom) or type tom$ and use tab completion. Once you do that, the following is more obvious. pc1=tom$rotation[,1] sd1=tom$sdev[1] column=c(sd1,pc1)

[R] Extracting columns from a class

2011-03-17 Thread nuncio m
Hi list, I am not a frequent user of R. Recently I used R in principal component analysis and got the result as a class, which has information like standard deviation and principal components from 1 to 10. How is it possible to extract the column corresponding to first principal