Hello, I would like to create an ascii text file that looks exactly like the Console output of a split() action. I have tried save, dput, dump, write.foreign and write to no avail. The resulting text files are a jumble of data that I would have to edit heavily in order to use it for my proposed purpose. How can I, short of copying and pasting the contents of the console (which will not work since the file is very large), output the information to a text file in a format like that on my screen? I am very new to R so please be kind. Thank you Steve
Is "sink" what you want? spencer graves Steve Sherman wrote:> Hello, > > I would like to create an ascii text file that looks exactly like the > Console output of a split() action. I have tried save, dput, dump, > write.foreign and write to no avail. The resulting text files are a > jumble of data that I would have to edit heavily in order to use it for > my proposed purpose. How can I, short of copying and pasting the > contents of the console (which will not work since the file is very > large), output the information to a text file in a format like that on > my screen? > > I am very new to R so please be kind. > > Thank you > Steve > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html-- Spencer Graves, PhD Senior Development Engineer PDF Solutions, Inc. 333 West San Carlos Street Suite 700 San Jose, CA 95110, USA spencer.graves at pdf.com www.pdf.com <http://www.pdf.com> Tel: 408-938-4420 Fax: 408-280-7915
See ?sink.... Sean ----- Original Message ----- From: "Steve Sherman" <ssherman at cemml.colostate.edu> To: <r-help at stat.math.ethz.ch> Sent: Friday, June 24, 2005 2:10 PM Subject: [R] text file output> Hello, > > I would like to create an ascii text file that looks exactly like the > Console output of a split() action. I have tried save, dput, dump, > write.foreign and write to no avail. The resulting text files are a > jumble of data that I would have to edit heavily in order to use it for > my proposed purpose. How can I, short of copying and pasting the > contents of the console (which will not work since the file is very > large), output the information to a text file in a format like that on > my screen? > > I am very new to R so please be kind. > > Thank you > Steve > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
Steve Sherman wrote:> Hello, > > I would like to create an ascii text file that looks exactly like the > Console output of a split() action. I have tried save, dput, dump, > write.foreign and write to no avail. The resulting text files are a > jumble of data that I would have to edit heavily in order to use it for > my proposed purpose. How can I, short of copying and pasting the > contents of the console (which will not work since the file is very > large), output the information to a text file in a format like that on > my screen?Two ways: 1. You can sink() the console output. 2. Probably you really want something like object <- split(...) for(i in seq(along=object)) write.table(SplitObject[[i]], file = names(SplitObject)[i]) Uwe Ligges> I am very new to R so please be kind. > > Thank you > Steve > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Sink is exactly what I needed. Thanks to all who suggested it. I was also impressed by the quick response to question. Uwe Ligges wrote:> Steve Sherman wrote: > >> Hello, >> >> I would like to create an ascii text file that looks exactly like the >> Console output of a split() action. I have tried save, dput, dump, >> write.foreign and write to no avail. The resulting text files are a >> jumble of data that I would have to edit heavily in order to use it >> for my proposed purpose. How can I, short of copying and pasting the >> contents of the console (which will not work since the file is very >> large), output the information to a text file in a format like that >> on my screen? > > > Two ways: > > 1. You can sink() the console output. > > 2. Probably you really want something like > object <- split(...) > for(i in seq(along=object)) > write.table(SplitObject[[i]], file = names(SplitObject)[i]) > > > Uwe Ligges > > >> I am very new to R so please be kind. >> >> Thank you >> Steve >> >> ______________________________________________ >> R-help at stat.math.ethz.ch mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide! >> http://www.R-project.org/posting-guide.html > >