[R-sig-Geo] plot points in grid-plot with sp.layout

Paul Hiemstra p.hiemstra at geo.uu.nl
Thu Oct 15 10:33:37 CEST 2009


Tom Gottfried wrote:
> Hi list,
>
> the last plot in the following code ends up with error messages in the plot:
>
> data(meuse.grid)
> data(meuse)
> coordinates(meuse.grid) <- ~x+y
> coordinates(meuse) <- ~x+y
> meuse.grid <- as(as(meuse.grid, "SpatialPixelsDataFrame"),
>     "SpatialGridDataFrame")
>
> spplot(meuse) # works
> spplot(meuse, sp.layout=list(sp.points,
>     meuse, col="red")) # works
>
> spplot(meuse.grid) # works
> spplot(meuse.grid, sp.layout=list(sp.points, meuse)) # does not work
>   
works:				  ___________
spplot(meuse.grid, sp.layout=list("sp.points", meuse))

use quotes around sp.points. Or else it will look for the R object sp.points, which is not present.

cheers,
Paul

>
> What can I do to make the points being plotted on top of the grid?
>
> Thanks in advance!!
>
> Tom
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>   


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +3130 274 3113 Mon-Tue
Phone:  +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul



More information about the R-sig-Geo mailing list