python boxplot significance_Indicating significance with ggplot2, in a boxplot

The solution given above by @dww (use label = "p.signif") is the correct one:

cmpr

myplot + stat_compare_means(comparisons = cmpr, tip.length=0.01,

label = "p.signif",

symnum.args = list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05, 1),

symbols = c("****", "***", "**", "*", "ns")))

EDIT: I modified stat_compare_means because this function seems to ignore symnum.args:

my_stat_compare_means

method.args = list(), ref.group = NULL, comparisons = NULL,

hide.ns = FALSE, label.sep = ", ", label = NULL, label.x.npc = "left",

label.y.npc = "top", label.x = NULL, label.y = NULL, tip.length = 0.03,

symnum.args = list(), geom = "text", position = "identity",

na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...)

{

if (!is.null(comparisons)) {

method.info

method

method.args

if (method == "wilcox.test")

method.args$exact

pms

size

color

map_signif_level

if (is.null(label))

label

if (ggpubr:::.is_p.signif_in_mapping(mapping) | (label %in% "p.signif")) {

if (ggpubr:::.is_empty(symnum.args)) {

map_signif_level

`**` = 0.01, `*` = 0.05, ns = 1)

} else {

map_signif_level

}

if (hide.ns)

names(map_signif_level)[5]

}

step_increase

ggsignif::geom_signif(comparisons = comparisons, y_position = label.y,

test = method, test.args = method.args, step_increase = step_increase,

size = size, color = color, map_signif_level = map_signif_level,

tip_length = tip.length, data = data)

} else {

mapping

layer(stat = StatCompareMeans, data = data, mapping = mapping,

geom = geom, position = position, show.legend = show.legend,

inherit.aes = inherit.aes, params = list(label.x.npc = label.x.npc,

label.y.npc = label.y.npc, label.x = label.x,

label.y = label.y, label.sep = label.sep, method = method,

method.args = method.args, paired = paired, ref.group = ref.group,

symnum.args = symnum.args, hide.ns = hide.ns,

na.rm = na.rm, ...))

}

}

symnum.args

myplot + my_stat_compare_means(comparisons = cmpr, tip.length=0.01,

label = "p.signif", symnum.args = symnum.args)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值