## Attach sample data (isric data) from the package
data(isric)
pf <- subset(isric, Sample=="Benin2")
library(minpack.lm)
a=Dstart(pf)[1];b=Dstart(pf)[2]; j=Dstart(pf)[3]; k=Dstart(pf)[4]-1
brook.ns <- nlsLM(y ~ Brook(x,thr,ths,alp,nscal), data=pf,
control = nls.lm.control(maxiter=200),
start = c(thr= a, ths = b, alp= j, nscal= k))
summary(brook.ns)## To produce a summary of modelling results
Run the code above in your browser using DataLab