[R] Error handling in nlme call

From: Rob Forsyth <r.j.forsyth_at_newcastle.ac.uk>
Date: Thu, 31 Jan 2008 09:51:48 +0000

In some trial simulation work I need to create batch files that will repeatedly generate pseudoreplicate datasets and then create non- linear mixed effects models using nlme. Inevitably these models sometimes fail to converge but I need the batch file to simply move on to another simulation rather than abort. I am using the try() function as in


which handles reported errors such as the "Step halving in PNLS step" error well. On rare runs however the nlme function hangs without an error message. Aborting the script prompts a notification of multiple warnings and warnings() gives multiple recurrences of "Singular precision matrix in level -1, block 1". I understand why these occur but would like to trap these events too and simply move on to the next simulation. The try() function doesn't work presumably as no actual error message is reported during the run. Is there a way to test for this condition?


Rob Forsyth

R-help_at_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. Received on Thu 31 Jan 2008 - 09:56:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 31 Jan 2008 - 12:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive