ggpubr
ggpubr copied to clipboard
stat_cor to provide low p-value (and not p < 2.2e-16)
Hi, I really enjoy this package and very frequently use the stat_cor function within ggplot. I have one problem though: I would like to display very low p-values and not p < 2.2e-16. Is there a way to work around this one line of code (line 221 currently) in the stat_cor function?
label <- ifelse(x < 2.2e-16, "p < 2.2e-16", paste0("p = ", x))
Any feedback is much appreciated!
Hi,
We're having a similar problem to this. We are comparing two sets of groups. If one comparison has a pvalue < 2.2e-16 and another one higher, then p =
does not appear.
Code to reproduce this error:
dt <- data.table(values = c(rnorm(1000), rnorm(1000), rnorm(1000, 10)), groups = rep(c('a','b','c'), each = 1000))
ggplot(dt, aes(groups, values)) + geom_boxplot()+ stat_compare_means(comparisons = list(c('a', 'b'), c('a', 'c')))
Hello, I am have the same question as the original post. Did you ever find a way to display the actual p value, instead of p < 2.2e-16?
Thank you!