[Rd] No exit codes from RTerm (Windows) (PR#9296)

ripley at stats.ox.ac.uk ripley at stats.ox.ac.uk
Sat Oct 14 10:39:19 CEST 2006


Rterm (sic) does return an error status.  You have not provided a 
reproducible example, so here is one (done in tcsh)

% echo 'q()' | rterm --vanilla --slave || echo failed
% echo 'q(status=3)' | rterm --vanilla --slave || echo failed
failed
% echo 'stop("test")' | rterm --vanilla --slave || echo failed
Error: test
Execution halted
failed

Whatever the problem is in your case, it is not what you have erroneously 
reported as a bug.  (BTW, I knew this worked as the R scripts, including 
the build process, make heavy use of it.)

On Fri, 13 Oct 2006, russell-lenth at uiowa.edu wrote:

> Full_Name: Russell V. Lenth
> Version: 2.3.1

Not current: see the FAQ which asks you not to report on obselete versions 
of R.

> OS: Windows XP Pro
> Submission from: (NULL) (128.255.132.188)
>
>
> I wrote a simple .BAT file to run the Sweave function on a file (via RTerm),
> then run pdflatex on the result (after RTerm exits).  The issue is that if an
> error condition occurs in RTerm, it is prudent to not do the pdflatex processing
> afterward.
>
> Here are the relevant statements in the BAT script:
>
>    echo Sweave("%1",style=F,eps=F) | Rterm --no-save --no-restore
>    if not errorlevel == 0 goto end
>
> The problem is that the errorlevel seems to always be 0, even if an error
> occurs.  I have a similar shell script for our linux system, and it works
> correctly.  Are there no provisions for RTerm to return an exit code in Windows?
> It would be very useful to me if it would return a nonzero exit code when there
> is an error.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-devel mailing list