Export all figures and tables to Rda files within one function. This primary purpose of this function is to quickly export all available figures and tables. We recommend running individual plotting functions for greater customization of figures and tables.

save_all_plots(
  dat,
  interactive = FALSE,
  figures_tables_dir = getwd(),
  plot_recruitment_options = list(module = "TIME_SERIES"),
  plot_natural_mortality_options = list(module = "Natural_Mortality"),
  table_total_catch_options = list(module = "TIME_SERIES"),
  ...
)

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.

interactive

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

Default: FALSE

figures_tables_dir

Path. Directory where the rda files are saved, in "figures" and "tables" folders that are created if needed.

Default: the working directory (getwd())

plot_recruitment_options

List. List object of parameter values to pass directly to the plot_recruitment function. All default parameters for the plot_recruitment function, except for dat, can be overridden with this list object.

Default: list(module = "TIME_SERIES")

plot_natural_mortality_options

List. List object of parameter values to pass directly to the plot_natural_mortality_options function. All default parameters for the plot_natural_mortality_options function, except for dat, can be overridden with this list object.

Default: list(module = "Natural_Mortality")

table_total_catch_options

List. List object of parameter values to pass directly to the table_total_catch_options function. All default parameters for the table_total_catch_options function, except for dat, can be overridden with this list object.

Default: list(module = "TIME_SERIES")

... Additional list objects of parameter values to pass directly to corresponding plot or table functions. Parameter names should follow the naming convention {function_name}_options. All default parameters, except for dat, of this function can be overridden with this list object. See example.

...

Arguments called from geom_line or geom_point

Value

Rda files for each figure/table.

Details

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

Examples

if (FALSE) { # \dontrun{
save_all_plots(
  dat = example_data,
  plot_spawning_biomass_options = list(
    ref_line = "unfished"
  ),
  plot_abundance_at_age_options = list(
    scale_amount = 1,
    proportional = FALSE
  )
)
} # }
if (FALSE) { # \dontrun{
save_all_plots(
   dat = example_data,
   figures_tables_dir = fs::path("outputs/figures"),
   plot_recruitment_options = list(
     module = "TIME_SERIES",
     unit_label = "mt"
   ),
   plot_spawning_biomass_options = list(
     ref_line = "unfished"     # customize reference line for spawning biomass plot
   ),
   plot_abundance_at_age_options = list(
     scale_amount = 1,         # custom scale for abundance-at-age plot
     proportional = FALSE      # don't proportionalize abundance-at-age
   ),
   plot_spr_options = list(
     ylab = "Fishing Intensity (1-SPR)/(1-SPR_ref)" # custom Y label for SPR plot
   ),
   plot_fishing_mortality_options = list(
     facet = "fleet",    # facet fishing mortality plot by "fleet"
     group = "fleet"     # group fishing mortality plot by "fleet"
   )
)
} # }