指定比较stat_compare_means

时间:2019-06-17 17:14:38

标签: r ggpubr

我正在尝试使用ggpubr和ggplot2在我的箱线图中绘制p值。 我有多个因素。

这是我当前的代码和情节:

ggplot(dat.czm.annot.otu,aes(x=Antibiotics,y=counts,fill=Diet))+geom_boxplot(alpha=0.8)+
   geom_point(aes(fill=Diet,color=Time),size = 3, shape = 21,position = position_jitterdodge(jitter.width = 0.02,jitter.height = 0))+
   stat_compare_means(method = "t.test")+
   ggtitle(otu)+
#   scale_x_discrete(labels= c("I+","I-","bulk soil"))+
   ylab("counts")+
   theme(plot.title = element_text(size = 18, face = "bold"))+
   theme(axis.text=element_text(size=14),
         axis.title=element_text(size=14)) + 
   theme(legend.text=element_text(size=14),
         legend.title=element_text(size=14)) +
   theme(strip.text.x = element_text(size = 14))

这是当前情节: enter image description here

我看了一些使用比较列表指定的示例。但我看不到它如何适用于这两个因素。
任何帮助表示赞赏。 谢谢,

0 个答案:

没有答案
相关问题