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 such as historical ("early"), current ("time"), or projected ("fore") data if filtering should occur. Default is set to "time" which is the current time. To plot all data, set era to NULL.

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 if the resulting figures should be relative spawning biomass. The default is `FALSE`. `ref_line` indicates which reference point to use.

scale_amount

A number describing how much to scale down the quantities shown on the y axis. For example, scale_amount = 100 would scale down a value from 500,000 –> 5,000. This scale will be reflected in the y axis label.

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")
} # }