This high level function extracts results from Stock Synthesis model runs. Give it a directory which contains directories for different "scenario" runs, within which are iterations. It writes two data.frames to file: one for single scalar values (e.g., MSY) and a second that contains output for each year of the same model (timeseries, e.g., biomass(year)). These can always be joined later.

get_results_all(
  directory = getwd(),
  overwrite_files = FALSE,
  user_scenarios = NULL,
  type = c("long", "wide"),
  filename_prefix = "ss3sim"
)

Arguments

directory

The directory which contains scenario folders with results.

overwrite_files

A switch to determine if existing files should be overwritten, useful for testing purposes or if new iterations are run.

user_scenarios

A character vector of scenarios that should be read in. Default is NULL, which indicates find all scenario folders in directory.

type

A character string specifying if you want the results to be written to the disk and returned as a long or wide data frame, where the default is "long".

filename_prefix

A character string specifying a prefix to append to the filename. Defaults to "ss3sim".

Value

Returns a list of 3 dataframes: scalar, ts, and dq. Creates two .csv files in the current working directory, where the names of those files are based on filename_prefix

and the default leads to the following: ss3sim_ts.csv and ss3sim_scalar.csv.

Author

Cole Monnahan, Merrill Rudd, Kathryn L. Doering