Skip to content

writing to an Excel file

3 messages · Laura Holt, PIKAL Petr, Brian Ripley

#
Hi R!

Is there a special function that writes data to an Excel file, please?

I found read.spss and so on in the foreign library, but nothing to write.

Of course, writing to a regular data file and importing into Excel works 
fine, but I thought that there might be another way.

Thanks in advance.

Sincerely,
Laura Holt
mailto: lauraholt_983 at hotmail.com
R Version 2.0.1 Windows
#
Hi Laura

Pretty common question. You could find an answer going through 
archives.
To copy to Excel through clipboard:

write.excel<-function(tab, ...) write.table( tab, "clipboard", 
sep="\t", row.names=F)

write.excel(your.data.frame)

open Excel and press ctrl-C

Cheers
Petr
On 10 Apr 2005 at 19:56, Laura Holt wrote:

            
Petr Pikal
petr.pikal at precheza.cz
#
On Mon, 11 Apr 2005, Petr Pikal wrote:

            
Well, that is essentially

`writing to a regular data file and importing into Excel',

it just stores the data file on the clipboard.

Another way is to use RDCOM and Rexcel and drive this from Excel.  But 
that needs additional software installed.