[R-sig-Geo] spplot.points not recognizing logical variables
Edzer Pebesma
edzer.pebesma at uni-muenster.de
Thu Feb 19 09:48:53 CET 2009
Thanks for mentioning this; the bug has creeped in when I modified code
to allow for multiple panels with factor variables. I'll update later today.
--
Edzer
David Rossiter wrote:
> As of the last time I compiled code like the following (17-June-2008),
> it displayed an indicator map:
>
> require(sp)
> data(meuse)
> # indicator: which observations have high Zn content?
> meuse$ind <- (meuse$zinc > 300)
> table(meuse$ind)
> coordinates(meuse) <- ~x +y
> class(meuse) # SpatialPointsDataFrame
> spplot(meuse, zcol="ind")
>
> But now, with sp 0.9.29, both on Mac OS X 10.5.3 and Win XP (both with R
> 2.8.1 and all the latest updates) I get this message:
>
> # Error in create.z(as(obj, "data.frame"), zcol) :
> # no support for variable of this type
>
> Converting to numeric gives me the map I want:
>
> meuse$ind.n <- as.numeric(meuse$ind)
> spplot(meuse, zcol="ind.n")
>
> Is there any reason why support for T/F variables was removed from
> spplot.points? I try to teach my students to use the correct class, and
> here clearly it's logical. It defeats the purpose to have to convert to
> numeric! These are not 0/1 they are F/T.
>
> Thanks,
>
> D G Rossiter
> ITC Enschede (NL)
>
> International Institute for Geo-Information Science and Earth Observation (ITC)
> Chamber of Commerce: 410 27 560
>
> E-mail disclaimer
> The information in this e-mail, including any attachments, is intended for the addressee only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the content of this information is strictly prohibited. If you have received this e-mail by mistake, please delete the message and any attachment and inform the sender by return e-mail. ITC accepts no liability for any error or omission in the message content or for damage of any kind that may arise as a result of e-mail transmission.
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de/
http://www.springer.com/978-0-387-78170-9 e.pebesma at wwu.de
More information about the R-sig-Geo
mailing list