Well, this is not entirely beautiful, but he should get a real job (showing you how to get this kind of work).
The basic idea is to rewrite the formula so that it does not have a bunch of names on its LHS (i.e. lower.bound + mean + upper.bound ). This syntax is equivalent to defining the term groups= , which ends with running panel.superpose() , which is the kind of pain you need to configure as you want.
Instead, I simply include mean in the LHS, and then use subscripts inside the custom panel function to select the corresponding upper.bound and lower.bound elements in each case.
I hope the rest is pretty clear:
LABS <- LETTERS[1:4] with(df, dotplot(mean ~ code | problem * topic, lb=lower.bound, ub=upper.bound, mpch = c(3,1)[consistent+1], ylim = extendrange(c(0,100)), panel = function(x, y, lb, ub, mpch, ..., subscripts) { panel.dotplot(x, y, ..., pch=mpch[subscripts]) lpoints(x, lb[subscripts], pch=6) lpoints(x, ub[subscripts], pch=2) lsegments(x,lb[subscripts],x,ub[subscripts],col="grey60") ltext(x=x[3], y=95, LABS[panel.number()], col="red",fontface=2) }, scales = list(x = list(draw = FALSE)), as.table = TRUE) )
