[R] save output of print() to txt file

Ana rrasterr at gmail.com
Thu Jan 5 18:05:30 CET 2012


I am looking for other option to write the output of the print command in R

I am using sink() to write the R output to a file. This is similar to
what I have:

> a=c(1:30)
> a
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22
23 24 25 26 27 28 29 30
> sink("vectorA.txt");print(a);sink()

I am looking for othe roptions to save the output of the print()
command to text file, not to save the objects.

Is there any other way of doing this?

Thanks!



More information about the R-help mailing list