ggplot常用的不同条件下实验组和对照组结果比较

ggplot常用的不同条件下实验组和对照组结果比较_第1张图片

目前还不够漂亮  美化嘛根据实际需求再做吧

library(dplyr)

group_by(test1, group) %>%

  summarise(

    count = n(),

    mean = mean(value, na.rm = TRUE),

    sd = sd(value, na.rm = TRUE)

  )

# Plot weight by group and color by group

library("ggpubr")

ggboxplot(test1, x = "group", y = "value", 

          color = "sex", palette = c("#00AFBB", "#E7B800"),

        ylab = "value", xlab = "group")+ geom_point(position = "jitter" )+ scale_x_discrete(limits=c("m0","w0","m1","w1","m2","w2"))

##### position = position_jitter(width = 0.5, height = 0)

###### shape="dose"

#### 增加不同组间的p-value值,可以自定义需要标注的组间比较

##my_comparisons <- list(c("0.5", "1"), c("1", "2"), c("0.5", "2"))

##p+stat_compare_means(comparisons = my_comparisons)+ #不同组间的比较

##stat_compare_means(label.y = 50)

你可能感兴趣的:(ggplot常用的不同条件下实验组和对照组结果比较)