Skip to content
Prev 43959 / 398525 Next

how to use try()

On Mon, 9 Feb 2004, r.ghezzo wrote:

            
You want either both assignments inside the try()
try({
	lo<-nls(....)
	beta[i]<-lo$m$getPars(4)
})

or both outside

lo<- try(nls(....))
if (inherits(lo,"try-error")) beta[i]<-NA else beta[i]<-lo$m$getPars()[4]


	-thomas