CodePudding user response:
The solution in the linked question will actually produce this result. You just need to make sure that the standard error is subtracted instead of added when the bar points down:
limits <- aes(ymax = resp se * sign(resp))
Now your plotting code is pretty much unaltered:
dodge <- position_dodge(width = 0.9)
ggplot(df, aes(fill = group, y = resp, x = trt))
geom_bar(position = dodge, stat = "identity")
geom_uperrorbar(limits, position = dodge, width = 0.25)