什么aov()、summary()然后annotate(),搞这么复杂。 一句 stat_compare_means(method = "anova")就能搞定的事。
library(ggplot2)
library(ggpubr)
ggplot(df,aes(x =variable,y=value ,color=group,fill=group)+
geom_boxplot(outlier.alpha = 0,alpha=0.3,
position = position_dodge(width = 0.9))+
theme_classic()+
stat_compare_means(method = "anova")