I’m running a principal component analysis on a dataset with more than 1000 variables. I’m using R Studio and when I run the summary to see the cumulative variance of the components, I can only see the last few hundred components. How do I limit the summary to only show, say, the first 100 components?
I’m running a principal component analysis on a dataset with more than 1000 variables.
Share
It’s pretty easy to modify
print.summary.princomp(you can see the original code by typingstats:::print.summary.princomp) to do this:Edited To include a basic check for a sensible value for
n. Now that I’ve done this, I wonder if it isn’t worth suggesting to R Core as a permanent addition; seems simple and like it might be useful.