I am trying to add p_values to my graph using \"stat_signif\" function.
The problem is that my boxplots are grouped box plots where I want to compare every 2 box plots of th
You haven't posted enough data to get p-values, so I'm posting an example that you can adjust to your dataset:
library(tidyverse)
library(ggpubr)
mtcars %>%
mutate_at(vars(am, cyl), as.factor) %>%
ggplot(aes(cyl, disp, fill=am))+
geom_boxplot()+
stat_compare_means(aes(group = am))
You can usestat_compare_means(aes(group = am), label = "p.format")
if you want to have only the p values in your plot.