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

R. Michael Weylandt michael.weylandt at gmail.com
Thu Jan 5 18:19:08 CET 2012


cat(file = )

M

On Thu, Jan 5, 2012 at 11:05 AM, Ana <rrasterr at gmail.com> wrote:
> 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!
>
> ______________________________________________
> 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.



More information about the R-help mailing list