0

I'm fitting a non-linear model to a large number (1000s) of data curves. I expect that the model cannot be fit to some of the curves, so when going through the data set I'd like to ignore those few cases for which nls returns an error and continue. The basic nls function provides a way to do this with the warnOnly=TRUE parameter which is passed by using nls.control. I also wanted to try the nlsLM function from the minpack.lm package. It seems, however, that even though the argument list for nlsLM is the same as that for nls, the warnOnly= parameter isn't available. Is there some other way of avoiding termination when nlsLM encounters an error? Thanks.

Fleetboat
  • 189
  • 7

1 Answers1

0

After searching around on 'error' and 'message', it seems that one way to address this type of problem simply is by using try(). I enclosed the statement in the try wrapper and the code runs through the entire data set without terminating on an error.

Fleetboat
  • 189
  • 7