将数据按颜色/填充/组分组时,如果指定了ref.group,则stat_compare_means不起作用。
敌人的示例,此代码有效:
ggbarplot(ToothGrowth,x = "dose",y = "len",add = "mean_se",color = "supp",palette = "jco",position = position_dodge(0.8))+
stat_compare_means(aes(group = supp),label = "p.signif",label.y = 29)
ggline(ToothGrowth,palette = "jco")+
stat_compare_means(aes(group = supp),label.y = c(16,25,29))
但这不是:
ggbarplot(ToothGrowth,29),ref.group='OJ')
Warning message:
Computation failed in `stat_compare_means()`:
missing value where TRUE/FALSE needed