Johannes Graumann
2010-Mar-08 09:04 UTC
[R] Lattice: barchart, error bars and grouped data
Hi, How can I, given the code snippet below, draw the error bars in the center of each grouped bar rather than in the center of the group? Thanks for any hints, Joh library(lattice) barley[["SD"]] <- 5 barchart( yield ~ variety | site, data = barley, groups=year, origin=0, lowDev=barley[["SD"]], highDev=barley[["SD"]], panel = function( x, y, ..., lowDev, highDev ){ panel.barchart(x, y, ...) panel.segments( as.numeric(x), as.numeric(y) - lowDev, as.numeric(x), as.numeric(y) + highDev, col = 'red', lwd = 2, ...) } )
Johannes wrote:> > > How can I, given the code snippet below, draw the error bars in the center > of each grouped bar rather than in the center of the group? >http://markmail.org/message/oljgimkav2qcdyre Dieter -- View this message in context: http://n4.nabble.com/Lattice-barchart-error-bars-and-grouped-data-tp1584239p1584376.html Sent from the R help mailing list archive at Nabble.com.
Johannes Graumann
2010-Mar-10 07:58 UTC
[R] Lattice: barchart, error bars and grouped data
Thanks. I switched to ggplot2 which offers error bars. Joh Dieter Menne wrote:> > > Johannes wrote: >> >> >> How can I, given the code snippet below, draw the error bars in the >> center of each grouped bar rather than in the center of the group? >> > > http://markmail.org/message/oljgimkav2qcdyre > > Dieter >