Skip to content

BATCH and testing

2 messages · Terry Therneau, Brian Ripley

#
In a few of my test scripts for the survival code I expect warning messages
(I actually try to trigger a couple).  Using R BATCH infile outfile these
messages don't end up in outfile, where I can compare them to what was
expected.  I don't see an option to change this.
  R < infile >& outfile works.  But is there a way to get it to continue on
after errors?

	Terry T.
#
On Thu, 25 Dec 2008, Terry Therneau wrote:

            
I don't see this:

tystie% cat infile
2+3
warning("test of warning")
4+5

tystie% cat outfile

R version 2.8.1 (2008-12-22)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

   Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[1] 5
Warning message:
test of warning
[1] 9
user  system elapsed
   0.314   0.037   0.346

so the asked-for reproducible example, please.
In [t]csh, I presume.  BATCH uses 2>1%, the sh equivalent.
options(error=expression(NULL))

as given in the help for stop().