Learn R Programming

ss3sim (version 0.9.0)

get_results_scenario: Extract SS3 simulation results for one scenario.

Description

Function that extracts results from all replicates inside a supplied scenario folder. The function writes 3 .csv files to the scenario folder: (1) scalar metrics with one value per replicate (e.g. $R_0$, $h$), (2) a timeseries data ('ts') which contains multiple values per replicate (e.g. $SSB_y$ for a range of years $y$), and (3) [currently disabled and not tested] residuals on the log scale from the surveys across all replicates. The function get_results_all loops through these .csv files and combines them together into a single "final" dataframe.

Usage

get_results_scenario(scenario, directory = getwd(), overwrite_files = FALSE)

Arguments

scenario
A single character giving the scenario from which to extract results.
directory
The directory which contains the scenario folder.
overwrite_files
A boolean (default is FALSE) for whether to delete any files previously created with this function. This is intended to be used if replicates were added since the last time it was called, or any changes were made to this function.

See Also

Other get-results: get_results_all, get_results_derived, get_results_scalar, get_results_timeseries

Examples

Run this code
d <- system.file("extdata", package = "ss3sim")
case_folder <- paste0(d, "/eg-cases")
om <- paste0(d, "/models/cod-om")
em <- paste0(d, "/models/cod-em")
run_ss3sim(iterations = 1:2, scenarios =
  c("D0-F0-G0-S0-cod"),
  case_folder = case_folder, om_dir = om, em_dir = em,
  bias_adjust = FALSE)
get_results_scenario(c("D0-F0-G0-S0-cod"))

Run the code above in your browser using DataLab