[R] hang-up during nlme call

JJ josh8912 at yahoo.com
Tue Dec 21 03:46:18 CET 2004


Hello:
I recently asked the list a question regarding
warning.expression.  This is a different statement of
the problem.  

I am doing a large simulation experiment using nlme
and most of the data realizations run fine.  The
simulations stall, however, on a few particularly
noisy data sets.  What happens is that the nlme
function initially calls the nlm function and some
code in there generates an endless number of warning
messages.  These are: "Warning: Singular precision
matrix in level ...".  Becuse of this, my simulation
is caught in an endless loop and after quite a while R
crashes.

I do use try(nlme(...)), so if I could find a way to
flag these warning and make them into errors, such as
by calling stop(), then my code could move on to the
next realizaton of the simulation.  Some warnings are
produced that are not endless or otherwise
problematic, so I do not want to cause an error for
every warning.  

Does anyone have any ideas as to how to identify
warning messages and call stop() or otherwise induce
an error if the warnings are of a particular type?  

John




More information about the R-help mailing list