目标:
我正在尝试添加显着性值以比较分组的箱形图,即比较感染和未感染的值。我也想忽略不重要值的注释。
当前情况:
我能够比较不同的列,即FA 16:0与18:0之间的列,但不能比较不同组之间的相同列,即,受感染与未感染的FA 16:0。
当前代码:
ggplot(data = FA.m, aes(x=variable, y=value)) + geom_boxplot(aes(fill=Group), outlier.size=-1) +
theme(axis.ticks = element_blank(),
axis.text.x = element_text(size=9, angle=),
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_rect(fill = "white", colour = "white",),
legend.title = element_blank()) +
coord_cartesian(ylim = c(14, 21)) +
scale_x_discrete(name ="FA") +
geom_signif(test="wilcox.test",
comparisons = combn(levels(FA.m$variable),2, simplify = F)[-4], map_signif_level = c("***"=0.001, "**"=0.01, "*"=0.05), size = 0)
我认为这是我需要更改的代码,但不确定。...
comparisons = combn(levels(FA.m$variable),2, simplify = F)[-4]