Skip to contents

Add significance label and line to a plot

Usage

add_significance(
  df,
  size_star = 2.5,
  lw = 0.2,
  color = "black",
  linetype = "solid"
)

Arguments

df

A dataframe containing one column per variable in the desired aesthetics (x, y, colour, etc.) and the following columns:

  • x_star: x position of the star label

  • y_star: y position of the star label

  • stars: the star label (e.g., "", "", "")

  • x_line: x position of the start of the line

  • x_line_end: x position of the end of the line

  • y_line: y position of the line

size_star

Size of the star label. Default is 2.5.

lw

Line width of the significance line. Default is 0.2.

color

Color of the star label and line. Default is "black".

linetype

Line type of the significance line. Default is "solid".

Value

A list of ggplot2 layers that can be added to a ggplot object.