[R] Export R output in Excel

John Dougherty jwd at surewest.net
Thu Dec 29 09:46:01 CET 2016


On Wed, 28 Dec 2016 13:45:25 -0800
Bryan Mac <bryanmac.24 at gmail.com> wrote:

> Hi,
> 
> How do I export results from R to Excel in a format-friendly way? For
> example, when I copy and paste my results into excel, the formatting
> is messed up.
> 
> Thanks.
>  
> Bryan Mac
> bryanmac.24 at gmail.com
>
Your purpose is not clear.  If you are planning to do MORE statistical
work with excel using R output, don't do it.  Learn the R equivalents.
There's nothing that you can do in Excel that can't be done in R.  And,
while Microsoft has made great strides in the reliability of it's
numbers and calculating routines, it is still a spreadsheet.

If you want to add tabular data to a word file from R, out
put it to a csv or tab delimited format and then copy into Word or
LibreOffice Writer. From there you can select the text of the table and
transform it into a table using the table menu. If you want formatted
statistical output, you can sink() the output to an asscii or utf
text file, paste it into Word and then convert the font of the pasted
segment to a fixed pitch font.  R output tends to follow the old-time
typewriter approach to formatting (spaces and tabs), meaning that kerned
fonts behave in horrible ways, fonts are rubbery, etc.


-- 

John



More information about the R-help mailing list