[R-sig-Geo] Setting order of levels of factor using sciplot_bargraph.CI

moses selebatso selebatsom at yahoo.co.uk
Wed Apr 6 00:43:02 CEST 2016


I am trying to plot bargraph using bargraph.CI  but it used default order (alphabetical order). However,  I would to display in the re-ordered levels. I managed to re-order, but I cannot get the new order on the graph display! See my scripts below and please help.
> h<-read.csv("clipboard",sep="\t")
> attach(h)
> order <- factor(order, levels = c("Wet", "Cold Early-Dry", "Hot Late-Dry"), ordered = TRUE)
> order
[1] Wet            Cold Early-Dry Hot Late-Dry  
Levels: Wet Cold Early-Dry Hot Late-Dry
> bargraph.CI(Season, Grass.Height, group = Habitat, data = h, xlab = "Season", ylab = "Grass Height (cm)", cex.lab = 1.5, x.leg = 1.5,col = "black", angle = 45, cex.names = 1, density = c(0,20), legend = TRUE)


Regards,
Moses SELEBATSO Home:    (+267) 318 5219 (H)  Mobile:  (+267) 716 39370  or  (+267) 738 39370"Those who will ALWAYS agree with you may be oppressed by you"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20160405/59cfbae3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: datauri-file.png
Type: image/png
Size: 13215 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20160405/59cfbae3/attachment.png>


More information about the R-sig-Geo mailing list