Re: [R] Newbie question about saving results

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Sun 14 Jan 2007 - 05:25:25 GMT

On 1/14/2007 12:17 AM, David Kaplan wrote:
> Hi all,
>
> When I run a procedure and the results are printed to the console, is
> there a way to just save the results? When I save to file, it also
> saves the syntax of the procedure. Thanks in advance,

You can redirect results to a file, using the sink() function, e.g.

sink("results.txt")
1+1

will print the answer in the file. Use sink() to redirect output back to the console.

Duncan Murdoch



R-help@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 and provide commented, minimal, self-contained, reproducible code. Received on Sun Jan 14 16:29:10 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 14 Jan 2007 - 11:30:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.