[R-gui] Small annoyance while interacting with R

Duncan Murdoch murdoch at stats.uwo.ca
Mon Oct 24 17:49:10 CEST 2005


On 10/24/2005 11:36 AM, Thomas Friedrichsmeier wrote:
> Hi,
> 
>> I'm trying to write some program in Ruby to interact with the R console but
>> it doesn't work : in short, I can connect R standard input, output and
>> error and retrieve correct calculations for correct inputs, but as soon as
>> R writes something to the standard error, the program exits.
> 
> this is from memory, and may not be entirely correct, but roughly it's this:
> If R notices it is not connected to a PTY, it goes into scripting/batch mode 
> (i.e. interactive () == FALSE). This means, it will exit on any error. As far 
> as I recall, this behavior cannot be changed, or at least not easily so.

It can be easily changed (at least on some platforms), but the method is 
not obvious.  In Windows if Rterm.exe is started with command line 
option --ess it acts pretty much the way Pablo wants.  This is 
documented as a Windows-only option; I'm not sure what the method would 
be to achieve the same on other platforms.

Duncan Murdoch



More information about the R-SIG-GUI mailing list