error capture
Check out the try function (?try). You would have to use try within the loop, at the step that has the potential to throw an error, and not around the whole loop. Hope this helps, -Chris
Tim Reid wrote:
Hi all, I am currently running some R code bootstrapping some data and running GLMs on the sampled data sets. Occasionally the data sets that are sampled cause errors in the GLM (usually with the message "Error in solve.default(as.matrix(fit$hessian)) "). Currently, if this occurs, the program stops and exits. I would like to know if there is a way I can instead of having the program terminate, to get the program to step through that problem and continue further on in the program (i.e. getting it to re-sample the data again). Any help would be much appreciated, tim. ----------------------------------------------------------------------- Tim Reid | PhD Candidate Quantitative Marine Sciences/ Antarctic Wildlife Research Unit School of Zoology University of Tasmania PO Box 252-05 Hobart Tasmania 7001 Australia phone: +61 3 6226 2594 | mob: 0404 668 363 www.zoo.utas.edu.au/awru/ [[alternative HTML version deleted]]
_______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology