[R] set off error messages

Thomas Lumley tlumley at u.washington.edu
Tue Sep 26 18:26:59 CEST 2006

On Tue, 26 Sep 2006, Mollet, Fabian wrote:

> Hello there!
> I'm creacting a loop for(i in 1:n){...}within which I build a nls model 
> at each iteration. for some of the values of i, the algoritm in the nls 
> function doesn't converge or cannot find a solution and consequently an 
> error message is produced, and so my loop is interupted. The errors 
> don't really matter to me as all the other values might still be useful 
> and therefore I want to ignore the errors, so that that the return of 
> the models for which no solution is found should just be NA values, so 
> that I get a value for every i. How can I turn off the error message and 
> make return NA values instead?

This is a FAQ (7.32)


More information about the R-help mailing list