Windows 2000, updated R and packages. could somebody pleaseeeeeeeee help with saving a data.frame with column names into "\t" text files for later importing in other programs? It seems an easy task, yet... it beats me. thanks, Mihai Nica Jackson State University [[alternative HTML version deleted]]
?write.table setwd("c:\\temp") myDF <- data.frame(A = rnorm(100), B = rnorm(100)) write.table(myDF, file = "myDF.dat", sep = "\t", quote = F, row.names F) HTH, Andy
"Mihai Nica" <m_nica at hotmail.com> writes:> Windows 2000, updated R and packages. > > could somebody pleaseeeeeeeee help with saving a data.frame with > column names into "\t" text files for later importing in other > programs? It seems an easy task, yet... it beats me.See ?write.table You want to use something like write.table(myDataFrame, file = "myTabSeparatedFile.txt", sep = "\t")
many thanks to everybody... indeed it was simple, and i should have found the answer myself, since i DID read the R Data Import/Export manual... maybe it's the age :-) Mihai Nica Jackson State University [[alternative HTML version deleted]]
Mihai Nica wrote:> Windows 2000, updated R and packages. > > could somebody pleaseeeeeeeee help with saving a data.frame with column > names into "\t" text files for later importing in other programs? It seems an easy task, yet... it beats me.It's in the R Data Import/Export manual and in the help file ?write.table (hint: argument sep = "\t"). Uwe Ligges
> could somebody pleaseeeeeeeee help with saving a data.frame with > column names into "\t" text files for later importing in other > programs? It seems an easy task, yet... it beats me.write.table(mydf, file="foo.tbl", sep="\t", col.names=T) Where mydf is your data frame. If you don't want quoting you can also add 'quote=FALSE' cu Philipp -- Dr. Philipp Pagel Tel. +49-89-3187-3675 Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585 GSF - National Research Center for Environment and Health Ingolstaedter Landstrasse 1 85764 Neuherberg, Germany http://mips.gsf.de/~pagel
Maybe I don't understand your questions, but the documentation for "write.table" in S-Plus 2000, 6.2, and R 1.8.1 all mention a parameter "sep". Will this fix your problem? hope this helps. spencer graves Mihai Nica wrote:>Windows 2000, updated R and packages. > >could somebody pleaseeeeeeeee help with saving a data.frame with column >names into "\t" text files for later importing in other programs? It seems an easy task, yet... it beats me. > >thanks, > >Mihai Nica >Jackson State University > [[alternative HTML version deleted]] > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >