# NOT RUN {
library(ggplot2)
# data
df <- data.frame(x = iris$Species, y = iris$Sepal.Length)
# plot
p <- ggplot(df, aes(x, y)) + geom_boxplot()
# dataframe with pairwise comparison test results
df_pair <- ggstatsplot::pairwise_p(df, x, y)
# adding plot with
ggstatsplot:::ggsignif_adder(
plot = p,
df_pairwise = df_pair,
data = df
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab