R, Excel, and the Windows clipboard

by John on October 28, 2008

The Windows version of R has functions for reading from and writing to the clipboard. These can be used to move data back and forth between R and Windows applications such as Excel. However, there are a few gotchas. See the following link for details.

Moving data between R and Excel via the clipboard

{ 3 comments… read them below or add one }

1

Rob Hyndman 10.28.08 at 18:43

It is much easier to use the xlsReadWrite package.

2

John 10.28.08 at 19:18

Thanks! I need to check that out. Maybe the clipboard functions would still be useful for working with programs other than Excel.

3

Peter 10.29.08 at 07:38

I second the xlsReadWrite recommendation, as long as you are sure that your scripts will only need to run on windows. If not, check the ‘R data import/export manual’. It has a paragraph on reading Excel files. Read it online: http://cran.r-project.org/doc/manuals/R-data.html#Reading-Excel-spreadsheets or under the help menu in the windows version.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>