barplot with error bar in lattice

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

barplot with error bar in lattice

milton ruser
Dear all,

I have a data.frame like below and I need
to plot horizonal with error bar only for upper limit.
On the code below I am able to plot the bars within
groups, but I need (1) change from vertical to horizonal
plot and (2) add the error bar.

any hint are welcome.

milton
----

mydf<-read.table(stdin(),head=T,sep=",")
mygroup,xlabel,yvalue,error
Gr1,Bar1,1,0.5
Gr1,Bar2,2,0.7
Gr1,Bar3,2,1.0
Gr1,Bar4,2.5,0.5
Gr2,Bar1,1,2
Gr2,Bar2,1,1
Gr2,Bar3,3,1
Gr2,Bar4,4,0.5
require(lattice)
barchart(yvalue~xlabel|mygroup, data=mydf)

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.