Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.13 KB

README.md

File metadata and controls

37 lines (25 loc) · 1.13 KB

ggsignif

Easily add significance bars to your ggplots

Description

This package provides an easy way to indicate if two groups are significantly different. Commonly this is shown with a by a bar on top connecting the groups of interest which itself is annoted with the level of significance (NS, *, **, ***). The package provides a single layer (geom_signif) that takes the groups for comparison and the test (t.test, wilcox etc.) and adds the annotation to the plot.

Example

Install package

install.packages("ggsignif")

# Or for the latest development version
devtools::install_github("Artjom-Metro/ggsignif")

Plot significance

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)

Result Plot

For further details go the CRAN page and check the examples in the vignette.