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

save_all_plots(
  dat,
  recruitment_unit_label = "mt",
  recruitment_scale_amount = 1,
  relative = FALSE,
  proportional = TRUE,
  interactive = FALSE,
  figures_tables_dir = getwd(),
  ref_line = "msy",
  biomass_scale_amount = 1,
  landings_unit_label = "mt",
  spawning_biomass_label = "mt",
  spawning_biomass_scale_amount = 1,
  ref_line_sb = "msy",
  abundance_at_age_scale_amount = 1,
  abundance_at_age_unit_label = "fish",
  biomass_at_age_scale_amount = 1,
  biomass_at_age_unit_label = "mt",
  indices_unit_label = "",
  biomass_unit_label = "mt",
  catch_unit_label = "mt",
  catch_scale_amount = 1
)

Arguments

dat

A data frame or names list of data frames (input as `list()`) returned from convert_output. The first data frame in the list is used in calculation of a reference line if one is present

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.

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.

proportional

T/F to scale size of bubble plots

interactive

TRUE/FALSE; indicate whether the environment in which the function is operating is interactive. This bypasses some options for filtering when preparing data for the plot. Default is FALSE.

figures_tables_dir

The location of the folder containing figures and tables ("figures" and "tables").

ref_line

A string specifying the type of reference you want to compare biomass to. The default is `"msy"`, which looks for `"biomass_msy"` 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`. Other possibilities may include "target", "MSY", and "unfished". When the reference cannot be found, indicate the reference line 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.

abundance_at_age_scale_amount

A number describing how much to scale down the abundance quantities shown via bubble size. See `recruitment_scale_amount`.

abundance_at_age_unit_label

Abbreviated units for abundance at age

biomass_at_age_scale_amount

A number describing how much to scale down the biomass quantities shown via bubble size. See `recruitment_scale_amount`.

biomass_at_age_unit_label

Abbreviated units for biomass at age

indices_unit_label

Units for index of abundance/CPUE

biomass_unit_label

Abbreviated units for biomass

catch_unit_label

Abbreviated units for catch

catch_scale_amount

A number describing how much to scale down the catch quantities shown via bubble size. See `recruitment_scale_amount`.

Value

Rda files for each figure/table.

Examples

if (FALSE) { # \dontrun{
save_all_plots(dat,
  ref_line = "unfished",
  ref_line_sb = "target",
  indices_unit_label = "CPUE",
  biomass_at_age_scale_amount = 1,
  biomass_at_age_unit_label = "metric tons"
)
} # }