[R-sig-Geo] spplot with Spatial classes, not DataFrame

Roger Bivand Roger.Bivand at nhh.no
Thu Aug 9 11:36:28 CEST 2007


On Thu, 9 Aug 2007, Felix Andrews wrote:

> Hi again...
>
> I like spplot (in sp package), but I would like to able to plot
> simpler types like SpatialPolygons, SpatialPoints, etc. Even Polygons.
> And a default method could plot points using xy.coords. I do not see
> why a data.frame must be attached, it might not be relevant:
>
>> showMethods(spplot)
> Function: spplot (package sp)
> obj="SpatialGridDataFrame"
> obj="SpatialLinesDataFrame"
> obj="SpatialPixelsDataFrame"
> obj="SpatialPointsDataFrame"
> obj="SpatialPolygonsDataFrame"
>
> Also, I would like it if there was some way to _not_ draw a key in the
> SpatialPointsDataFrame method. Perhaps you could detect key=F or
> auto.key=F.

As in xyplot and levelplot, spplot needs a data frame, because lattice 
graphics are for viewing data frames, particularly conditioning on other 
variables. You can add other kinds of spatial objects to the data display 
through the sp.layout= argument, but a data frame has to be there. If you 
need to use the underlying grid graphics, you'll need something that isn't 
a front-end to xyplot or levelplot, I think.

Setting key.space="" removed the key for me in:

example(spplot)
spplot(meuse, c("zinc"), sp.layout=list(l2,l3,l4,l5, which = 2),
    key.space="")

but I don't know if this is intended.

Roger

>
> Regards,
> Felix
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list