[R] Mistake with contour...

v.demart@libero.it v.demart at libero.it
Tue Dec 30 09:19:24 CET 2003


I'm reading Ripley-Venables "Modern Applied Statistics with S - Fourth edition" , at the same time trying  the examples proposed in the book using R 1.8.1 under linux.

Now  I'm trying the following  code from the book (example code of spatial statistics at page 76) with R :

| data(topo) library("spatial") topo.loess<-loess(z ~ x * y, topo,
| degree= 2,span=0.25)
| topo.mar<-list(x=seq(0,6.5,0.2),y=seq(0,6.5,0.2))
| topo.lo=predict(topo.loess,expand.grid(topo.mar)) 
| par(pty="s")
| contour(topo.mar$x,topo.mar$y,topo.lo,xlab="",ylab="",levels=seq(700,1000,25),cex=0.7)

and at the "contour" command the following error pops up:

Error in contour.default(topo.mar$x, topo.mar$y, topo.lo, xlab = "",
ylab = "",  :
~    no proper `z' matrix specified

Being an R newbye I don't know what to do next to fix the problem.

Regards

Vittorio from Rome




More information about the R-help mailing list