[R] nls() error

Berend Hasselman bhh at xs4all.nl
Mon Apr 2 21:06:03 CEST 2012


On 02-04-2012, at 20:48, Jeff Breiwick wrote:

> Hello,
> 
> I am running a simple nls model (which a friend ran OK) but I get the 
> following error:
> 
> Error in nls(y ~ R * (1 - (x/K)^2), data = nls.dat, start = list(R = 0.3,  : 
>  object 'R_nls_iter' not found
> 
> Does anyone know what the 'R_nls_iter' error is? 
> 
> The data are:
> x=1:8 ; y=c(14,19,25,34,43,56,69,76) 
> # starting values: 
> R=.3, K=94

No Os, no R version, no context, no reproducible example.

So I tried this:

x <- 1:8 
y <- c(14,19,25,34,43,56,69,76) 
# starting values: 
R <- .3
K <- 94

nls.dat <- data.frame(x=x, y=y)

nls(y ~ R * (1 - (x/K)^2), data = nls.dat, start = list(R = 0.3, K=94))


and got this

> nls(y ~ R * (1 - (x/K)^2), data = nls.dat, start = list(R = 0.3, K=94))

Error in nls(y ~ R * (1 - (x/K)^2), data = nls.dat, start = list(R = 0.3,  : 
RMate stopped at line 0
  singular gradient
Execution halted

Berend

R2.15.0, Mac OS X 10.6.8



More information about the R-help mailing list