In ggplot2 I\'m attempting a simple thing that I just can\'t get for some reason. I have adjusted means and SE in a data frame and want to plot the means, error bars and th
As an alternative to mnel's answer, you could create a new variable, so that you have a column where all 3 groups have the same value:
data1$all <- "All"
And then use that as the group
aesthetic for your line:
ggplot(data1, aes(x=group, y=estimate)) +
geom_errorbar(aes(ymin=estimate-SE, ymax=estimate+SE),
colour="black", width=.1, position=pd) +
geom_line(aes(x=group, y=estimate, group=all)) +
geom_point(position=pd, size=4)
Mnel's answer is probably more elegant, but this might work better if the groups aren't numbers and can't be converted to numeric so straightforwardly.