Dear all, I would like to ask you if exists some way of having the results of an R instruction (for instance, "summary") in a table to copy it directly in Excel. Thank you very much in advance. Best wishes! Manuel
?write.table() 2009/12/14 Manuel Jes?s L?pez Rodr?guez <mjlr1980 at yahoo.es>:> Dear all, > I would like to ask you if exists some way of having the results of an R instruction (for instance, "summary") in a table to copy it directly in Excel. > Thank you very much in advance. > Best wishes! > > Manuel > ______________________________________________ > 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. >-- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis
Hi r-help-bounces at r-project.org napsal dne 14.12.2009 17:09:55:> Dear all, > I would like to ask you if exists some way of having the results of an R> instruction (for instance, "summary") in a table to copy it directly inExcel. What do you mean directly in Excel. If the output is structured like table you can use something like write.table(object, "clipboard", sep= "\t", row.names=F) You can copy an output from console just the same way as you use copy/paste procedure between Word and Excel. You can use some other more sophisticated ways (see data import/export manual or you can invent your own ways and preferred procedures too. Regards Petr> Thank you very much in advance. > Best wishes! > > Manuel > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
The two other responses I saw suggested using write.table, which is fine if the object is a data.frame, but maybe not so great if the object comes from summary on a model or aov. My memory from years gone by of Excel's handling of material that had been copied to the clipboard from webpages, is that it maintains the formatting quite well. You might want to look at xtable, which has an html method for the print function for xtable. I cannot test it in Excel but it gives formatted output for use in OpenOffice.org. install package xtable and then: library(xtable) ?xtable # and work through the examples on the help page. -- David. On Dec 14, 2009, at 10:09 AM, Manuel Jes?s L?pez Rodr?guez wrote:> Dear all, > I would like to ask you if exists some way of having the results of > an R instruction (for instance, "summary") in a table to copy it > directly in Excel. > Thank you very much in advance. > Best wishes!David Winsemius, MD Heritage Laboratories West Hartford, CT