You should already have standard errors (se) calculated beforehand. To add the error bars, use the geom_errorbar() function in ggplot expression. A working example might look like this:
geom_errorbar(aes(ymin = x - se, ymax = x + se))
Positioning
Adding the position_dodge() function in ggplot expression can map error bar correctly.
- Additionally, one can specify the
widthattribute to further tailor the appearance.