介绍
- ggplot2绘制分组误差棒图
加载R包
knitr::opts_chunk$set(message = FALSE, warning = FALSE)
library(tidyverse)
library(ggpubr)
library(rstatix)# rm(list = ls())
options(stringsAsFactors = F)
options(future.globals.maxSize = 10000 * 1024^2)
Importing data
df <- ToothGrowthdf$dose <- as.factor(df$dose)head(df, 3)
组间检验
stat.test <- df %>%group_by(dose) %>%t_test(len ~ supp) %>%adjust_pvalue(method = "bonferroni") %>%add_significance("p.adj") %>%add_xy_position(x = "dose", dodge = 0.8)stat.test