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",
  index_unit_label = "",
  biomass_unit_label = "mt",
  catch_unit_label = "mt",
  catch_scale_amount = 1
)

Arguments

dat

Data frame or list. A tibble or named list of tibbles (input as `list()`) returned from convert_output.

If inputting a list of tibbles, the first tibble's reference point defined in `ref_line` is used to plot a reference line or calculate relative spawning biomass.

recruitment_unit_label

String. Recruitment units

Default: "mt"

recruitment_scale_amount

Number. 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.

Default: 1

relative

Logical. TRUE/FALSE; specify whether to set y-axis values relative to the ref_line value.

Default: `FALSE`

proportional

Logical. TRUE/FALSE; scale size of bubble plots

Default: `TRUE`

interactive

Logical. TRUE/FALSE; indicate whether the environment is interactive.

Default: `FALSE`

figures_tables_dir

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

Default: the working directory (`getwd()`)

ref_line

String. Type of reference point 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).

Default: "msy"

Options: Including, but not limited to: "target", "MSY", "unfished"

biomass_scale_amount

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

Default: 1

landings_unit_label

String. Landings units

Default: "mt"

spawning_biomass_label

String. Spawning biomass units

Default: "mt"

spawning_biomass_scale_amount

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

Default: 1

ref_line_sb

String. Same as `ref_line`, but this argument is applied to plot_spawning_biomass.

Default: "msy"

Options: Including, but not limited to: "target", "MSY", "unfished"

abundance_at_age_scale_amount

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

Default: 1

abundance_at_age_unit_label

String. Abbreviated abundance at age units

Default: "fish"

biomass_at_age_scale_amount

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

Default: 1

biomass_at_age_unit_label

String. Abbreviated biomass at age units

Default: "mt"

index_unit_label

String. Index of abundance/CPUE units

Default: ""

biomass_unit_label

String. Abbreviated biomass units

Default: "mt"

catch_unit_label

String. Abbreviated catch units

Default: "mt"

catch_scale_amount

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

Default: 1

Value

Rda files for each figure/table.

Details

The input is from an assessment model output file translated to a standardized output (convert_output).

See also

[convert_output()], [create_rda()]

Examples

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