Re: [R] Printing output in STDOUT

From: Esmail Bonakdarian <esmail.js_at_gmail.com>
Date: Tue, 20 May 2008 12:30:15 -0400

Prof Brian Ripley wrote:

> On Tue, 20 May 2008, Esmail Bonakdarian wrote:
> 

>> Edward Wijaya wrote:
>>> Hi,
>>>
>>> Currently the R script I have is executed with this command:
>>>
>>> $ R CMD BATCH mycode.R
>>>
>>> And the output is stored in mycode.Rout.
>>>
>>> Is there a way I can issue command from shell (like above)
>>> so that the output is printed to STDOUT?
>>>
>>> It's troublesome to open the "Rout" file every time to debug.
>>
>> Under a Unix system you could try to pipe the command into tail -f
>>
>> i.e.,
>>
>> $ R CMD BATCH mycode.R | tail -f
>>
>> That should display the file as it gets written.
> 
> Buffering may get in the way -- so 'gets written' may be much later than 
> when it is output by R.

Yes, that's quite likely to be the case .. I like your suggestions below much better - saved away for future reference too.

Esmail



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. Received on Tue 20 May 2008 - 17:25:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 20 May 2008 - 18:30:38 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.

list of date sections of archive