美文网首页
绘图专题(3):ggpubr包(R)

绘图专题(3):ggpubr包(R)

作者: 挽山 | 来源:发表于2020-02-28 15:16 被阅读0次
#年龄画箱线图
colnames(Age.2)=c('年龄', '分组')
p<-ggboxplot(Age.2, x="分组", y="年龄", color = "分组", 
             palette = c("#FC4E07", "#00AFBB"), #, "#FC4E07" #E7B800
             add = "jitter",shape="分组")
my_comparisons <- list(c("ASD", "CTL"))
p+stat_compare_means(comparisons = my_comparisons)+stat_compare_means(label.y=68)
p+stat_compare_means(label.y=65, label.x = 1.4)
#箱线图+小提琴
ggviolin(Age.2, x="分组", y="年龄", fill = "分组", 
         palette = c("#FC4E07", "#00AFBB"), 
         add = "boxplot", add.params = list(fill="white"))+ 
  stat_compare_means(comparisons = my_comparisons, label ="p.signif")+ 
  stat_compare_means(label.y = 75,label.x = 1.3)#label这里表示选择显著性标记(星号)

相关文章

网友评论

      本文标题:绘图专题(3):ggpubr包(R)

      本文链接:https://www.haomeiwen.com/subject/dbdlhhtx.html