I have a dataset that looks something like this:
a <- data.frame(x=rep(c(1,2,3,5,7,10,15,20), 5), y=rnorm(40, sd=2) + rep(c(4,3.5,3,2.5,2,1.5,1,0.5), 5)) ggplot(a, aes(x=x,y=y)) + geom_point() +geom_smooth()

I want to get the same result as this graph, but instead of a smooth curve, I just want to take the line segments between the / sd averages for each set of x values. The graph should be similar to the graph above, but notched, not curved.
I tried this, but it fails, although the x values ββare not unique:
ggplot(a, aes(x=x,y=y)) + geom_point() +stat_smooth(aes(group=x, y=y, x=x)) geom_smooth: Only one unique x value each group.Maybe you want aes(group = 1)?