knitr::opts_chunk$set(
  collapse = TRUE,
  dpi = 300,
  warning = FALSE,
  message = FALSE,
  out.width = "100%",
  comment = "#>"
)

Statement of Need

During the exploratory analysis of data with discrete covariates, researchers commonly start with a one-way ANOVA to see if there are any differences in the group means. This is typically followed up with multiple comparisons to see if specific levels of the discrete covariates differ significantly. The ggsignif package provides a way to graphically display all or a few (depending on the context of the research hypotheses) of such comparisons. It is also used by other R package developers as the back-end for graphical display of pairwise comparisons, such as ggpubr [@Kassambara2020], ggstatsplot [@Patil2018], and more. These packages demonstrate how ggsignif can be extended to display results from any type of pairwise comparisons test (e.g., Bayesian t-test, Dunn test, etc.).

Features

The following is a simple example demonstrating how a group difference can be annotated using geom_signif layers from ggsignif package.

set.seed(123)
library(ggplot2)
library(ggsignif)

ggplot(mpg, aes(class, hwy)) +
  geom_boxplot() +
  geom_signif(
    comparisons = list(c("compact", "midsize"), c("minivan", "suv")),
    map_signif_level = TRUE
  ) +
  ylim(NA, 48)

For more advanced examples, the readers are encouraged to read the package website: https://const-ae.github.io/ggsignif/.

Licensing and Availability

ggsignif is licensed under the GNU General Public License (v3.0), with all source code stored at GitHub, and with a corresponding issue tracker for bug reporting and feature enhancements. In the spirit of honest and open science, we encourage requests/tips for fixes, feature updates, as well as general questions and concerns via direct interaction with contributors and developers, by filing an issue. See the Contribution Guidelines for this package.

Acknowledgements

We would like to thank the users of ggsignif package for reporting bugs and for providing valuable feedback.

This work was supported by the EMBL International PhD Programme (C.A.E.).

References



Artjom-Metro/ggsignif documentation built on April 26, 2024, 3:22 p.m.