R语言之可视化(24)生成带P值得箱线图
作者:
柳叶刀与小鼠标 | 来源:发表于
2019-05-20 01:35 被阅读5次
目录
R语言之可视化(24)生成带P值得箱线图
rm(list=ls())
library(ggpubr)
data("ToothGrowth")
library(ggsci)
pal = pal_lancet("lanonc" )(9)
colors = pal_lancet("lanonc")(9)[ 1:3]
my_comparisons = list(c("0.5","1"),c("1","2"), c("0.5","2"))
p = ggboxplot( ToothGrowth , x = "dose", y = "len", color = "dose" , palette =colors,
bxp.errorbar = T) +
stat_compare_means(comparisons = my_comparisons) +
stat_compare_means(method = "anova" , label.x = 1.7, label.y = 45)
p
p + stat_boxplot(geom ="errorbar", color = colors, width =0.4, size =1) +
geom_boxplot(aes(color = dose))
本文标题:R语言之可视化(24)生成带P值得箱线图
本文链接:https://www.haomeiwen.com/subject/zioczqtx.html
网友评论