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

russell-lenth at uiowa.edu russell-lenth at uiowa.edu
Sat Oct 14 19:56:05 CEST 2006


I am so embarrassed.  I now see the syntax error in my original batch 
file; and if I correct it, it works just fine.  I don't know why I 
didn't get a DOS error with it; if I had, it obviously would have saved 
me from reporting it as an R bug.  My apologies for causing trouble -- 
it definitely is not a bug in R.

best,

Russ
-- 
Russell V. Lenth, Professor
Department of Statistics
   & Actuarial Science            (319)335-0814    FAX (319)335-3017
The University of Iowa           russell-lenth at uiowa.edu
Iowa City, IA 52242  USA         http://www.stat.uiowa.edu/~rlenth/

Prof Brian Ripley wrote:
> 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
>>
>




More information about the R-devel mailing list