0

I have an Rscript I would like to run. It takes a very long time to run (took about 23 hours on a 64gb 32 node cluster). It keeps running into an error at this time. My boss told me to run the script locally on my macbook 4gb ram and use options(error=recover). This would stop the code at the error but allow me to enter R at the point of error and play around? Is that correct?

Anyways, I tried using Rscript options(error=recover) /path/to/file.R but I got can error -bash: syntax error near unexpected token "(". What is the proper syntax? I can't find it online...

Evan
  • 1,477
  • 1
  • 17
  • 34
  • 3
    the `options(error=recover)` has to be *inside* your script file, unless you get fancy. – Ben Bolker Nov 11 '15 at 01:02
  • thanks! and if I just run the Rscript and keep terminal in my background, then in like ~days it'll open into R with all the data.frames that were present right before the error? – Evan Nov 11 '15 at 01:06
  • presumably. If I were you I would test it with a small example that will break in a few minutes (i.e a script that consists of `options(error=recover); x<- 1:10; Sys.sleep(60); stop("break here")` – Ben Bolker Nov 11 '15 at 01:18
  • Ben, how do I open up the debugging environment after the recover is set into play. Can you look at my new post please? – Evan Nov 15 '15 at 20:30

0 Answers0