答:
可以尝试将ggpubr得到的显著性检验,自己再标注一下:
library(ggplot2)
library(ggpubr)
test1<-data.frame(value=rnorm(100),type="a")
test2<-data.frame(value=rnorm(100,mean = 5),type="b")
test<-rbind(test1,test2)
p<-ggboxplot(test,x="type",y="value")
p+theme(strip.text = element_text(size = 16))+stat_compare_means(size=5,hjust=0.05)
p+annotate(geom = "text",label=paste("Wilconxon:", "~italic(p)<2.2e-16"),x=1.5,y=7.5,parse=T,size=5)