R !!!stat_summary() {{outline}} ---- !!ggplotの中で処理 !平均の棒グラフ stat_summary(geom = "bar", fun = "mean") !平均の標準誤差(errorbar) stat_summary(geom = "errorbar", fun.data = "mean_se", width=0.2) !!例 {{pre g <- voc22vs23.dat %>% dplyr::filter(Year==2023) %>% ggplot() g <- g + aes(x=Gakunen, y=size, group=Enter, fill=Enter) g <- g + stat_summary(geom = "bar", fun = "mean") g <- g + stat_summary(geom = "errorbar", fun.data = "mean_se", width=0.2) g <- g + facet_grid(~Year) g <- g + labs(x="学年", y="単語数", title="語彙サイズ・2023年度") g <- g + scale_fill_discrete(name="入学年度") plot(g) }} !!References *https://qiita.com/swathci/items/b08496d863bca4b479b3#geom-1 *https://www.kani3blog.com/r_barplot_errorbar/