我过去常常运行这段代码来获取条形图顶部“n”的总和。
现在我收到以下错误:
忽略未知参数:fun.y
没有提供汇总函数,默认为
mean_se()
count %>%
ggplot(aes(x = date, y = n, group = class, fill = class)) +
geom_col() +
geom_text_repel(
aes(label = stat(y), group = date),
stat = 'summary', fun.y = sum, vjust = -1
)
Run Code Online (Sandbox Code Playgroud)