Hi, 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 http://pbil.univ-lyon1.fr/library/base/html/write.table.html> 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? thanks, chris -- View this message in context: http://www.nabble.com/Newbie%3AExport-Data-into-Excel-from-R-tp15788950p15788950.html Sent from the R help mailing list archive at Nabble.com.
You will likely need to escape that backslash, i.e. "c:\\foo.csv". Haris Skiadas Department of Mathematics and Computer Science Hanover College On Mar 2, 2008, at 10:12 AM, Keizer_71 wrote:> > Hi, > > 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 > http://pbil.univ-lyon1.fr/library/base/html/write.table.html > > >> 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? > > thanks, > chris > > > -- > View this message in context: http://www.nabble.com/Newbie%3AExport- > Data-into-Excel-from-R-tp15788950p15788950.html > Sent from the R help mailing list archive at Nabble.com. >
R uses unix type slashes that is "/" rather than "\" even if you're using Windows You probably need either to write file ="c:/foo.csv" or escape the "\" thusly file > "c:\\foo.csv" Either way should work. Personally find it easier to use '/". --- Keizer_71 <christophe.lo at gmail.com> wrote:> > Hi, > > 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 >http://pbil.univ-lyon1.fr/library/base/html/write.table.html> > > > 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? > > thanks, > chris > > > -- > View this message in context: >http://www.nabble.com/Newbie%3AExport-Data-into-Excel-from-R-tp15788950p15788950.html> Sent from the R help mailing list archive at > Nabble.com. > > ______________________________________________ > 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. >
Keizer_71 <christophe.lo at gmail.com> wrote in news:15788950.post at talk.nabble.com:> 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 > http://pbil.univ-lyon1.fr/library/base/html/write.table.html > > >> 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
Hi you can also write.table(probe_gene, file = "c:/foo.xls", sep = "\t", col.names = NA) or write.table(tab, "clipboard", sep = "\t" , col.names = NA) and after opening Excel just press Ctrl-V. Maybe you also find usefull to add row.names=FALSE into export construction. Petr petr.pikal at precheza.cz r-help-bounces at r-project.org napsal dne 02.03.2008 16:12:51:> > Hi, > > All i want is to export my list into c: drive and save it as csv fileand> manually import into Excel. > > I have the read the article but i am having issues > http://pbil.univ-lyon1.fr/library/base/html/write.table.html > > > > 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? > > thanks, > chris > > > -- > View this message in context:http://www.nabble.com/Newbie%3AExport-Data-into-> Excel-from-R-tp15788950p15788950.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.