Re: [R] Newbie:Export Data into Excel from R

From: David Winsemius <>
Date: Sun, 02 Mar 2008 16:30:52 +0000 (UTC)

Keizer_71 <> wrote in

> All i want is to export my list into c: drive and save it as csv
> file and manually import into Excel.
> I have the read the article but i am having issues

>> excel<-write.table(probe_gene, file = "c:\foo.csv", sep = ",",
>> col.names = NA)

> Error in file(file, ifelse(append, "a", "w")) :
> unable to open connection
> In addition: Warning message:
> cannot open file 'c:\foo.csv', reason 'Invalid argument'
> any suggestions?

One can use the file.choose() function in place of a quoted file name. I do so because it gets around the "\", "/", "\\" confusion in my brain, ... and it's faster.

R does not use solitary "\"'s in its filenames for directory separation. It's the <escape> character for regular expressions, and R's development in the *nix world trumped any need to be consistent with the dark side's use of "\" as a directory separator. You can use single "/" as well as "\\"

David Winsemius

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 02 Mar 2008 - 16:35:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 02 Mar 2008 - 17:30:18 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive