When I use the main function, as in the following code, I get a beautiful table that gives all the standardized loads, as well as a table with its own values, as well as the proportion and cumulative proportion.
rotatedpca <- principal(PCFdataset, nfactors = 8, rotate = "varimax", scores = T)
I would like to export this output to an excel file (using WriteXLS), but I can only do this for dataframes, and rotatedpca is not a data framework and cannot be forced into one. I can extract standardized loads using the following code:
loadings<-as.data.frame(unclass(rotatedpca$loadings))
But I cannot understand how to access other information that is usually displayed when I simply call the main function, in particular, the eigenvalues, proportion and cumulative dispersion are explained. I tried rotatedcpa $ values, but this returns what looks like eigenvalues ββfor all 12 source variables as factors without rotation, which I don't understand. And I could not find a way to even try to extract the explained variance values. How can I just create a data frame that looks like the output of R that I get below from the main function, for example?
RC2 RC3 RC8 RC1 RC4 RC5 RC6 RC7 SS loadings 1.52 1.50 1.45 1.44 1.01 1.00 0.99 0.98 Proportion Var 0.13 0.12 0.12 0.12 0.08 0.08 0.08 0.08 Cumulative Var 0.13 0.25 0.37 0.49 0.58 0.66 0.74 0.82 Proportion Explained 0.15 0.15 0.15 0.15 0.10 0.10 0.10 0.10 Cumulative Proportion 0.15 0.31 0.45 0.60 0.70 0.80 0.90 1.00
Thanks for reading my post!
cww
source share