Yimeng Lu wrote:
> Hello R-users,
> 
> In a loop, if a function, such as "nls", gives an error, is it possible to
> coerce R to continue proceeding the next command with the same
> loop?
> 

Yes, see the try() function.  The basic usage is something like

value <- try( some calculation )
if (inherits(value, "try-error"))   handle the error
else  handle a correct calculation

Duncan Murdoch

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to