[R] xtable prcomp

Charles Roosen croosen at mango-solutions.com
Thu Feb 23 11:03:28 CET 2012


Hi,

The "xtable" method for "summary.prcomp" is just creating a table of the "importance" values.  So you can get the same table for just a few of the PCs by subscripting the importance values:

    xtable(mySummary$importance[,1:2],digits=4)

Best,
Charlie

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Riccardo Romoli
Sent: 22 February 2012 23:22
To: r-help at r-project.org
Subject: [R] xtable prcomp

Hi, I need to export to LaTex the summary of a PCA. So:

myPCA <- prcomp(myDF)
mySummary <- summary(myPCA)
#
print(xtable(mySummary))

How can I export to LaTeX not all the summary but only the first nPCs??

Best
Riccardo

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
LEGAL NOTICE
This message is intended for the use o...{{dropped:10}}



More information about the R-help mailing list