我从教程中获得了以下代码,用于使用ggpubr中的函数,但输出图的统计测试结果下面没有括号(或线)。
library(ggpubr)
data("ToothGrowth")
p <- ggboxplot(ToothGrowth, x = "dose", y = "len",
color = "supp", palette = "jco",
add = "jitter")
p + stat_compare_means(aes(group = supp))

如果我必须使用aes(group = x))参数作为stat_compare_means()函数的比较组,有没有办法在值下面画一条线,如下图所示?谢谢。

发布于 2021-11-13 01:30:17
这就是你的意思吗?
library(ggpubr)
data("ToothGrowth")
p <- ggboxplot(ToothGrowth, x = "dose", y = "len",
color = "dose", palette = "jco",
add = "jitter")
my_comparisons <- list( c("0.5", "1"), c("1", "2"), c("0.5", "2") )
p + stat_compare_means(comparisons = my_comparisons)

https://stackoverflow.com/questions/69946578
复制相似问题