*disclaimer
793840
stat_summary()
ggplotの中で処理
平均の棒グラフ
stat_summary(geom = "bar", fun = "mean")
平均の標準誤差(errorbar)
stat_summary(geom = "errorbar", fun.data = "mean_se", width=0.2)
例
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)
https://sugiura-ken.org/wiki/