Hello,
to plot the result of a singular non linear regression (using nls) I usually 
use the function plotfit, for example:

r.PTG.V<-nls(PTG.P~ fz1(Portata, a,b), data=dati, start=list(a=10, b=10), 
nls.control(maxiter=200), algorithm='port', 
trace=TRUE, na.action=na.omit, lower=list(a=0, b=10), upper=list(a=100, b=100))
plotfit(r.PTG.V)

I tried to use the function plotfit on the result of the following for loop but 
I got an error message:
for (i in 1:length(formList))
{
    resultList[[i]] <- nls(formList[[i]], data=subset(dati, Fiume=="Laveggio"), 
start=startList7[[i]], 
    nls.control(maxiter=1000, warnOnly=TRUE), algorithm='port', 
na.action=na.omit,lower=lowerList7[[i]], 
    upper=upperList7[[i]])
}
plotfit(resultList[[1]]

"Error in diff(as.numeric(y[ord])) : 
  (list) object cannot be coerced to type 'double'"

Could somebody tell me what this error means? how can I fix this problem? 
Any suggestion appreciated!!
Thanks,
Laura

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to