[R-sig-Geo] spplot.points: one panel per level of a factor
Edzer Pebesma
edzer.pebesma at uni-muenster.de
Fri Oct 4 11:56:01 CEST 2013
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I don't think you are missing something here -- spplot doesn't do that
much more than the underlying lattice functions, and in particular it
tries to plot attributes of spatial features, using panels for
different attributes. Your question seems to only address plotting
points, sth that spplot does not try to.
You did not say which spplot options you want to take advantage of,
but suppose you want to add some referencing (a polygon), and remove
axis labels and tics, you might want to use:
library(sp)
demo(meuse, ask = FALSE)
xyplot(y~x|ffreq, as(meuse, "data.frame"), asp="iso",
panel = function(x,y,...) {
sp.polygons(meuse.riv)
# anything else you want to do in every panel
panel.xyplot(x,y,...)
},
scales = list(draw = FALSE),
xlab = NULL, ylab = NULL
)
Hth,
On 10/03/2013 10:25 PM, Alexandre Villers wrote:
> Good evening,
>
> I'm sure I'm missing something really obvious but I couldn't figure
> it out (or find the solution on the Internet). Is there a way to
> produce the same type of graph as
>
> library(lattice) data(meuse) xyplot(y~x|ffreq, meuse, asp=1)
>
> with spplot.points and a SpatialPointsDataFrame ?
>
> I would like to represent the locations of different individuals
> on different panels but still taking advantage of the spplot
> options.
>
> Thanks in advance and sorry if this is a trivial question
>
> Alex
>
> [[alternative HTML version deleted]]
>
> _______________________________________________ R-sig-Geo mailing
> list R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
- --
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
83 33081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJSTpCxAAoJEM1OCHCtOnfxc1cH/0+uuzPASfCHPv8FJoTI0rZL
gG2Jt1mKHWXe8XZo8aBLN8SBRRrATlabtwoJ3GKDOunLgZ0x2DiWR387J/KoqI0c
NmNNq2dijkv1pJEWrK6gBYW+yVU90US6lSs23wG1sLaAcq/yhalg2wNbgf2zhsGN
6RqIihAEvu7EQk/mDMsG5websyUT5llA+Dt9eO5jamAvmBO58xKghcAz0oB5OLEI
hkNy2du2Uy5/GG+RGNwP9cUQWO2gQ8PbfAlxxp+YiGnERhyCdQ8vcFGdhCD0iFJB
Vk8iFL4GJ9Z+ubmU5EoK6+Syo/r2Ki8yLT4bcbLV7A/ZSyCYBV3ljn1uDshJ1rI=
=3epv
-----END PGP SIGNATURE-----
More information about the R-sig-Geo
mailing list