生信小木屋

library(tidyverse)
library(ggpubr)
p <- ggboxplot(airquality, 
               x = "Month", 
               y = "Ozone",
               color = "Month",
               add = "jitter", 
               shape = "Month")

my_comparisons <- list( c("5", "6"),c("7","8"))
p + stat_compare_means(comparisons = my_comparisons)+ # Add pairwise comparisons p-value
  stat_compare_means(label.y = 50)  
kruskal.test(Ozone ~ Month, data = airquality)

参考

https://rpkgs.datanovia.com/ggpubr/

graph LR A --- B B-->C[fa:fa-ban forbidden] B-->D(fa:fa-spinner);