I have a data-frame df in long format (several observations for each year). I want to plot the average of the variable length for each year across years with confidence intervals. I use this code:
ggplot(df[df$year>2004,],aes(x=year, y=length)) +
stat_summary(fun.data = "mean_cl_boot", geom = "smooth") +
xlab("") + ylab("Report Length") +
scale_x_continuous(breaks = seq(2005, max(df$year), by = 2))
The last time I ran this code it gave me the exact graph I want:
, but this time the confidence interval does not show up:
I did not change the code, but I did update all the packages and now I can't get the confidence intervals.
se = TRUE. As far as I know this the default, so I'm not sure why it doesn't show up without that. - aosmith