[R] how to print error message in batch mode

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Apr 7 13:39:00 CEST 2005


It is probably easier to use BATCH as in

 	R CMD BATCH prova output

See ?BATCH.  That does what Elio actually asked for.

On Thu, 7 Apr 2005, Achim Zeileis wrote:

> On Thu, 07 Apr 2005 12:45:16 +0200 Elio Mineo wrote:
>
>> Dear list,
>> I am using R in batch mode:
>>
>> $ R -q --no-save < prova > output
>>
>> the input file "prova" has these commands:
>>
>> data(USArrests)
>> x<-USArrests
>> hist(x)
>>
>> of course, the command hist(x) produces an error. The error message
>> is: Error in hist.default(x) : `x' must be numeric.
>> Is there the possibility to save this error massage in the "output"
>> file?
>
> You could do something like
>  $ R -q --no-save < prova > prova.out 2> prova.err
> Best,
> Z
>
>
>> Thanks in advance,
>> Angelo
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide!
>> http://www.R-project.org/posting-guide.html
>>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
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-help mailing list