this function adds a benchmark line (and optional label) to a ggplot object

add_benchmark(
  plot,
  y_int,
  plot_linetype = "dashed",
  plot_linecolor = OBI.color::prim_pink(),
  plot_linewidth = 0.8,
  add_label = F,
  label_text = NA,
  label_size = 5,
  label_xval = NA,
  label_yval = NA
)

Arguments

plot

ggplot object

y_int

Yintercept for geom_hline

plot_linetype

Type of line for benchmark; default is "dashed"

plot_linecolor

Color of line for benchmark (and benchmark label, if included); default is OBI.color::prim_pink()

plot_linewidth

Width of line for benchmark; default is "0.8

add_label

Whether or not benchmark should be labelled; default is FALSE

label_text

Text for benchmark label

label_size

Size of label text; default is 5

label_xval

x position for benchmark label

label_yval

y position for benchmark label