Hi, Ivo,

At Fri, 28 Dec 2012 16:34:03 -0800,
ivo welch wrote:
> so, it isn't obvious to me how I get to the try-error object
> list, or how to find out what triggered the abort.  

A try object is an object that captures the execution context at the
time of an error.  Consider the following code:

  > library(multicore)
  > result = mclapply(1:10, function (i) { if (i == 4) foo() else i })
  Warning message:
  In mclapply(1:10, function(i) { :
    scheduled core 4 encountered error in user code, all values of the job will 
be affected

To investigate the error, we can use the try object that has been
saved in position 4:

  > print(result[[4]])
  [1] "Error in FUN(4L[[1L]], ...) : could not find function \"foo\"\n"
  attr(,"class")
  [1] "try-error"
  attr(,"condition")
  <simpleError in FUN(4L[[1L]], ...): could not find function "foo"
  > traceback(result[[4]])
  1: Error in FUN(4L[[1L]], ...) : could not find function "foo"

Neal

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to