[R] error occurring in batch mode, not interactive mode: how to find cause of problem

Franckx Laurent laurent.franckx at vito.be
Mon Feb 4 09:21:00 CET 2013

Dear all,

I use R version 2.15.1 on  x86_64-pc-linux-gnu (64-bit).

I run a simulation where I have to call a series of R scripts in batch mode.

When I run the following two lines, this works well for PERIOD='17' but not for PERIOD='08':

R CMD BATCH  --no-save "--args PERIOD='08' YEAR='203O' SC='BAU' " preparecostvectors.R preparecostvectors08_2030.Rout
R CMD BATCH  --no-save "--args PERIOD='17' YEAR='2030' SC='BAU' " preparecostvectors.R preparecostvectors17_2030.Rout

The error message I get for PERIOD='08' is (but I do not think this is relevant for my main question):

Error in names(votlist) <- votname :
  'names' attribute [3] must be the same length as the vector [0]

I get this error message for all values of YEAR.

Oddly enough, when I run the script preparecostvectors.R interactively, all works perfectly fine. However, this is not a structural solution, because I need to be able to run my simulation for a large number of years.

I was wondering if any tools exist that could help me to reconstruct what went wrong in batch mode. I think I am familiar with most debugging tools in interactive mode, but how can I trace the origin of the problem when I get an error in batch mode?

Just to avoid any misunderstanding: I am not asking any help on the error message itself, just some suggestions on how I could trace what goes wrong when running R in batch mode.

Laurent Franckx, PhD
Boeretang 200, 2400 MOL, Belgium
Tel. + 32 14 33 58 22
Skype: laurent.franckx
laurent.franckx at vito.be
Visit our website: www.vito.be/english and http://www.vito.be/transport

VITO Disclaimer: http://www.vito.be/e-maildisclaimer

More information about the R-help mailing list