[R-sig-Geo] stplot - legend/classes of categorical vairable
Aurelie Cosandey Godin
GodinA at Dal.Ca
Wed May 6 19:18:57 CEST 2015
It didn’t seem to have fix the issue, here’s my sessionInfo()
Does the key in the correct order for you?
R version 3.1.3 (2015-03-09)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.2 (Yosemite)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RColorBrewer_1.0-5 sp_1.1-0 xts_0.9-7 zoo_1.7-11
[5] lattice_0.20-30 spacetime_1.1-4
loaded via a namespace (and not attached):
[1] grid_3.1.3 INLA_0.0-1428997066 intervals_0.15.0 Matrix_1.1-5
[5] splines_3.1.3 tools_3.1.3
On May 6, 2015, at 2:04 PM, Edzer Pebesma <edzer.pebesma at uni-muenster.de<mailto:edzer.pebesma at uni-muenster.de>> wrote:
On 05/06/2015 06:51 PM, Aurelie C.Godin wrote:
I'm not sure what you had expected: do you want them to decrease, in
value, from top to bottom? sp::spplot does it the same way stplot does now.
In the key with factor c("a", "b", "c”), “a" appears at the bottom, followed by “b" and “c” (bottom to top), but when these are changed for c('0','(0,5]','(5,25]') , then their order in the key are different e.g., “a" = “0” is appearing at the top rather than the bottom and the key is not in order i.e., now from bottom to top: (0,5], (5,25] , 0.
I can't reproduce this; what is your sessionInfo()? Maybe updating
spacetime helps?
I’m not sure what you mean by :
sp::spplot does it the same way stplot does now.
On May 6, 2015, at 1:27 PM, edzer [via R-sig-geo] <ml-node+s2731867n7588201h68 at n2.nabble.com<mailto:ml-node+s2731867n7588201h68 at n2.nabble.com><mailto:ml-node+s2731867n7588201h68 at n2.nabble.com>> wrote:
On 05/06/2015 04:35 PM, Aurelie C.Godin wrote:
I'm getting strange behavior in the bar legend with factors ...
I cut my data into intervals and plotted results using stplot, however now
the levels are not appearing in the same order as levels(factor)...?
For example, I get the same problem here:
library(spacetime)
example(STFDF)
set.seed(42)
gridded(stfdf at sp) = TRUE
stfdf$f = factor(sample(c("a", "b", "c"), 12, replace = TRUE))
levels(stfdf$f)
levels(stfdf$f)<-c('0','(0,5]','(5,25]')
levels(stfdf$f)
library(RColorBrewer)
stplot(stfdf[,,"f"], col.regions = brewer.pal(3, "Accent"))
Thoughts on how to fix this?
I'm not sure what you had expected: do you want them to decrease, in
value, from top to bottom? sp::spplot does it the same way stplot does now.
-----
Aurelie Cosandey-Godin
Ph.D. Student, Department of Biology, Dalhousie University
Industrial Graduate Fellow, WWF-Canada
Email: [hidden email]<x-msg://2/user/SendEmail.jtp?type=node&node=7588201&i=0> | Web: wormlab.biology.dal.ca<http://wormlab.biology.dal.ca><http://wormlab.biology.dal.ca>
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/stplot-legend-classes-of-categorical-vairable-tp7587860p7588200.html
Sent from the R-sig-geo mailing list archive at Nabble.com<http://Nabble.com><http://Nabble.com>.
_______________________________________________
R-sig-Geo mailing list
[hidden email]<x-msg://2/user/SendEmail.jtp?type=node&node=7588201&i=1>
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; +49 251 83 33081
Journal of Statistical Software: http://www.jstatsoft.org/
Computers & Geosciences: http://elsevier.com/locate/cageo/
Spatial Statistics Society http://www.spatialstatistics.info<http://www.spatialstatistics.info/>
_______________________________________________
R-sig-Geo mailing list
[hidden email]<x-msg://2/user/SendEmail.jtp?type=node&node=7588201&i=2>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[http://r-sig-geo.2731867.n2.nabble.com/images/icon_attachment.gif] signature.asc (501 bytes) Download Attachment<http://r-sig-geo.2731867.n2.nabble.com/attachment/7588201/0/signature.asc>
________________________________
If you reply to this email, your message will be added to the discussion below:
http://r-sig-geo.2731867.n2.nabble.com/stplot-legend-classes-of-categorical-vairable-tp7587860p7588201.html
To unsubscribe from stplot - legend/classes of categorical vairable, click here<http://r-sig-geo.2731867.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7587860&code=Z29kaW5hQGRhbC5jYXw3NTg3ODYwfDE5MzkwMjI1NTk=>.
NAML<http://r-sig-geo.2731867.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
--
Aurelie Cosandey-Godin, PhD
Dalhousie University, Department of Biology
godina at dal.ca<mailto:godina at dal.ca> | m: +1 902 499-0984
-----
Aurelie Cosandey-Godin, Ph.D.
Postdoctoral Research Fellow, Department of Biology, Dalhousie University
godina at dal.ca | wormlab.biology.dal.ca
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/stplot-legend-classes-of-categorical-vairable-tp7587860p7588202.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
_______________________________________________
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; +49 251 83 33081
Journal of Statistical Software: http://www.jstatsoft.org/
Computers & Geosciences: http://elsevier.com/locate/cageo/
Spatial Statistics Society http://www.spatialstatistics.info
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org<mailto:R-sig-Geo at r-project.org>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
--
Aurelie Cosandey-Godin, PhD
Dalhousie University, Department of Biology
godina at dal.ca<mailto:godina at dal.ca> | m: +1 902 499-0984
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list