[R] capture stderr in Windows

Duncan Murdoch murdoch at stats.uwo.ca
Mon Aug 16 19:43:52 CEST 2004

On Mon, 16 Aug 2004 10:25:08 -0700, "Moises Hassan"
<mhassan at scitegic.com> wrote :

>I'm using the following command to run R in Windows
>"Rterm --no-save --no-restore < "Rscriptfile" > "Rstdoutfile"
>How can I capture the text sent by R to stderr in a file?

That depends on your shell.  The standard Windows command shell
COMMAND.COM or CMD.EXE provides no easy way to do this.  There are
lots of replacement shells around that can do it; I use Cygwin's bash
shell most of the time.

There are also programs on the net that do nothing but redirect
standard handles, e.g. <http://www.commandline.co.uk/mtee/index.html>.
I've never tested these.

Duncan Murdoch

More information about the R-help mailing list