geom_errorbarh(mapping = NULL, data = NULL, stat = "identity",
position = "identity", ...)
aes
or aes_string
. Only needs to be set
at the layer level if you are overriding the plot defaults.# Define the top and bottom of the errorbars
p <- ggplot(df, aes(resp, trt, colour = group)) p + geom_point() + geom_errorbarh(aes(xmax = resp + se, xmin = resp - se)) p + geom_point() + geom_errorbarh(aes(xmax = resp + se, xmin = resp - se, height = .2))
geom_errorbar
: vertical error bars