Re: [R] Save object summary to file

2008-09-12 Thread pgseye
Thanks Yihui and to others who replied privately. Very helpful information. Regards, Paul pgseye wrote: > > Hi, > > Am wanting to save the summary of a PCA to file. > > Have tried: > >> write.table(summary(PCA), file="PCAvar.txt", sep="\t") > > but receive: > > Error in as.data.frame.de

Re: [R] Save object summary to file

2008-09-11 Thread Yihui Xie
Hi, The returned value of summary.princomp() is NOT a data.frame and cannot be coerced into a data.frame (it's a list), so you cannot write it into a file using write.table(). I guess what you really intend to write is: # x <- summa

[R] Save object summary to file

2008-09-11 Thread pgseye
Hi, Am wanting to save the summary of a PCA to file. Have tried: > write.table(summary(PCA), file="PCAvar.txt", sep="\t") but receive: Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class "summary.princomp" into a data.frame Wh