Given the following example library(lattice) attach(barley)
After a long meandering around the web I managed to get a side by side boxplots through: bwplot(yield ~ site, data = barley, groups=year, pch = "|", box.width = 1/3, auto.key = list(points = FALSE, rectangles = TRUE, space = "right"), panel = panel.superpose, panel.groups = function(x, y, ..., group.number) { panel.bwplot(x + (group.number-1.5)/3, y, ...) } ) now, my objective is to superpose the average for each boxplot; I’ve been learning, again somewhere around the web, that this task has something to do (obviously) first of all with the calculation of the averages, i.e. something like: mean.values <- tapply(y, x, mean) and then with the superposition of relative average values to the boxplots, i.e. something like: panel.points(…, mean.values, ..., pch = 17) but for some reasons I’m not able to properly combine these code snippets in a successful way any help much appreciated, thank you -- View this message in context: http://r.789695.n4.nabble.com/Lattice-side-by-side-boxplots-with-average-tp4617831.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.