Plot spawning biomass with a reference line as a dashed line. The figure can also be made relative to this reference line rather than in absolute units.

plot_spawning_biomass(
  dat,
  unit_label = "metric ton",
  scale_amount = 1,
  ref_line = c("target", "unfished", "msy"),
  ref_point = NULL,
  end_year = NULL,
  relative = FALSE,
  n_projected_years = 10,
  make_rda = FALSE,
  rda_dir = getwd()
)

Arguments

dat

A data frame returned from `asar::convert_output()`.

unit_label

units for spawning_biomass

scale_amount

indicate the exact amount of scale (i.e. 1000)

ref_line

A string specifying the type of reference you want to compare spawning biomass to. The default is `"target"`, which looks for `"spawning_biomass_target"` in the `"label"` column of `dat`. The actual searching in `dat` is case agnostic and will work with either upper- or lower-case letters but you must use one of the options specified in the default list to ensure that the label on the figure looks correct regardless of how it is specified in `dat`.

ref_point

A known value of the reference point along with the label for the reference point as specified in the output file. Please use this option if the ref_line cannot find your desired point. Indicate the reference point in the form c("label" = value).

end_year

last year of assessment

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.

n_projected_years

Number of years spawning biomass is projected for. By default this number is set to 10

make_rda

TRUE/FALSE; indicate whether to produce an .rda file containing a list with the figure/table, caption, and alternative text (if figure). If TRUE, the .rda will be exported to the folder indicated in the argument "rda_dir". Default is FALSE.

rda_dir

The location of the folder containing the generated .rda files ("rda_files") that will be created if the argument `make_rda` = TRUE. Default is the working directory.

Value

Plot spawning biomass from the results of an assessment model translated to the standard output. The ggplot2 object is returned for further modifications if needed.