[R] Getting Batch mode to continue running a script after running into errors

Josh jcchang at mednet.ucla.edu
Fri Jun 13 00:52:08 CEST 2008


I'm invoking R in batch mode from a bash script as follows:

R --no-restore --no-save --vanilla
<$TARGET/$directory/o2sat-$VERSION.R>
$TARGET/$directory/o2sat-$VERSION.Routput

When R comes across some error in the script however it seems to halt
instead of running subsequent lines in the script:

Error in file(file, "r") : cannot open the connection
Calls: read.table -> file
In addition: Warning message:
In file(file, "r") :
  cannot open file '/datapool/experiments/ois/080502/petri': No such
file or directory
Execution halted


How can I get R to continue running the script even if it comes across
errors? Thanks in advance



More information about the R-help mailing list