if( !require('investr') ){ install.packages('investr', dependencies=TRUE, repos='http://cran.rstudio.com/') } library(investr) # has the function plotFit load(file='../../BookCode/NRAIA/data/Leaves.rda') plot(Leaves$Time, Leaves$Length, xlab='Time', ylab='Length') grid() source('../../BookCode/NRAIA/R/SSRichards.R') Leaves.m1 = nls(Length ~ SSRichards(Time, d, e, b, f), data=Leaves) print(summary(Leaves.m1)) #postscript("../../WriteUp/Graphics/Chapter3/chap_3_prob_2.eps", onefile=FALSE, horizontal=FALSE) plotFit(Leaves.m1, main='Leaves data and fit') grid() #dev.off()