Hi,

I use lapply with a function from a package, and every 20th to 50th function 
execution (out of 500 to 10 000 times) fails for some unknown reason. RAM 
consumption ever increases (out of limit) and execution time is endless. I am 
not going to debug the package. (I rather feel like an end-user.)

If it was Java, I'd wrap the function in a try...catch statement like about

try{
    for(i=1;i<=10000;i++){
        dofunction(i);
        }
    }
catch(outofmemoryexception e){
    kill(dofunctioninstance);
    gc();
    next;
    }


I did not find out how to construct this in R. Is anyone so kind to point me to 
a documentation more exhaustive than help(conditions)? Or otherwise provide a 
snippet of R code?

Regards, Joachim

______________________________________________
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