[R] Newbie question about saving results

Duncan Murdoch murdoch at stats.uwo.ca
Sun Jan 14 06:25:25 CET 2007


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



More information about the R-help mailing list