Export all figures and tables to Rda files within one function.

exp_all_figs_tables(
  dat,
  recruitment_unit_label = "mt",
  recruitment_scale_amount = 1,
  end_year = NULL,
  n_projected_years = 10,
  relative = FALSE,
  rda_dir = getwd(),
  ref_line = c("target", "MSY", "msy", "unfished"),
  ref_point = NULL,
  biomass_scale_amount = 1,
  landings_unit_label = "mt",
  spawning_biomass_label = "mt",
  spawning_biomass_scale_amount = 1,
  ref_line_sb = c("target", "MSY", "msy", "unfished"),
  ref_point_sb = NULL,
  indices_unit_label = NULL,
  biomass_unit_label = "mt",
  catch_unit_label = "mt"
)

Arguments

dat

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

recruitment_unit_label

Units for recruitment

recruitment_scale_amount

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

end_year

last year of assessment

n_projected_years

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

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.

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.

ref_line

A string specifying the type of reference you want to compare biomass to. The default is `"target"`, which looks for `"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).

biomass_scale_amount

A number describing how much to scale down the biomass quantities shown on the y axis. See `recruitment_scale_amount`.

landings_unit_label

Units for landings

spawning_biomass_label

Units for spawning biomass

spawning_biomass_scale_amount

A number describing how much to scale down the spawning biomass quantities shown on the y axis. See `recruitment_scale_amount`.

ref_line_sb

Identical definition as `ref_line`, but this argument is applied to plot_spawning_biomass.

ref_point_sb

Identical definition as `ref_point`, but this argument is applied to plot_spawning_biomass.

indices_unit_label

Units for index of abundance/CPUE

biomass_unit_label

Abbreviated units for biomass

catch_unit_label

Abbreviated units for catch

Value

Rda files for each figure/table.

Examples

if (FALSE) { # \dontrun{
exp_all_figs_tables(dat,
  end_year = 2022, ref_line = "unfished", ref_point = 13000,
  ref_point_sb = 13000, ref_line_sb = "target", indices_unit_label = "CPUE"
)
} # }