Yes, some form of try() is often needed with nls() to avoid scripts stopping.

You might also find nlxb() from package nlsr more reliable in finding 
solutions. It uses analytic derivatives if
available if the model is given as an expression, and a Marquardt stabilized 
solver. But do expect it to take more
iterations. The syntax is close, but not perfectly equivalent, to that of nls().

JN

On 2017-10-20 11:20 AM, Jeff Newmiller wrote:
> ?tryCatch
>

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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