Preformatted reference line

reference_line(
  plot,
  dat,
  era = "time",
  label_name,
  reference,
  relative = FALSE,
  scale_amount = 1
)

Arguments

plot

a ggplot2 object where the reference line will be added

dat

standard data frame where reference point should be extracted

era

A string naming the era of data.

Default: "time"

Options: "early", "time", "fore" (forecast), or NULL (all data)

label_name

string of the name of the quantity that users want to extract the reference point from

reference

string. name of the reference point such as "msy", "unfished", or "target"

relative

A logical value specifying to set y-axis values relative to the ref_line value.

Default: `FALSE`

scale_amount

A number to scale the y-axis values.

Default: 1

Value

a ggplot2 geom_hline object for a reference point that can be added to a plot

Examples

if (FALSE) { # \dontrun{
reference_line(dat, "biomass", "msy")
} # }