Just replacing preplot() with predict() should be fine. BTW, it's always a good idea to specify the version of the package you're using as well.
Best, Andy From: mh...@berkeley.edu > > Hi, > > I'm trying to work through the examples and code in Loader's > LOCAL REGRESSION AND LIKELIHOOD, and have run into a problem > with the code for one sided smoothing and change point analysis > (p. 110-112). > > The code, after loading locfit: > > midp<-(1945:1988)+0.5 > fitl<-locfit(thickness~left(year), data=penny, alpha=c(0,10), > deg=1, ev=midp) > fitr<-locfit(thickness~right(year),data=penny, alpha=c(0,10), > deg=1, ev=midp) > plot((preplot(fitr)-preplot(fitl))^2, type="b") > > the error message crops up after the plot command and is: > > Error in preplot(fitr) - preplot(fitl) : > non-numeric argument to binary operator > > looking at preplot(fitr0 and preplot(fitl) shows a list with > numeric values. > > Any suggestions on how to resolve this problem? I'm using R > 2.7.1 on a > Windows XP machine with Service pack 2. > > best and thanks, Mark Hall > > PS--a similar error case occurs using R 2.3.1 and 2.5.1 > > ______________________________________________ > 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. > Notice: This e-mail message, together with any attachme...{{dropped:10}} ______________________________________________ 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.