Adding geom_signif
to ggplot
ggsignif_adder( plot, df_pairwise, data, x, y, pairwise.display = "significant", ggsignif.args = list(textsize = 3, tip_length = 0.01), ... )
plot | A |
---|---|
df_pairwise | A dataframe containing results from pairwise comparisons
(produced by |
data | A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted. |
x | The grouping variable from the dataframe |
y | The response (a.k.a. outcome or dependent) variable from the
dataframe |
pairwise.display | Decides which pairwise comparisons to display.
Available options are |
ggsignif.args | A list of additional aesthetic
arguments to be passed to |
... | Currently ignored. |
set.seed(123) library(ggplot2) # plot p <- ggplot(iris, aes(Species, Sepal.Length)) + geom_boxplot() # dataframe with pairwise comparison test results df_pair <- pairwiseComparisons::pairwise_comparisons( data = iris, x = Species, y = Sepal.Length ) # adding a geom for pairwise comparisons ggstatsplot:::ggsignif_adder( plot = p, data = iris, x = Species, y = Sepal.Length, df_pairwise = df_pair )