[R] locfit questions/problems

mhall at berkeley.edu mhall at berkeley.edu
Mon Jan 25 06:45:43 CET 2010


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



More information about the R-help mailing list