data(isric)
pf <- subset(isric, Sample=="Nicaragua38")
library(minpack.lm)
campbel.ns <- nlsLM(y ~ Campbel(x,ths,alp,nscal), data=pf,
control = nls.lm.control(maxiter=200),
start = c(ths = Dstart(pf)[2],
alp=Dstart(pf)[3], nscal=-1*(Dstart(pf)[4]-1)))
plot(fitted(campbel.ns),pf$y)
coef(campbel.ns)
Run the code above in your browser using DataLab