Create a folder containing retrospective runs for a given base-model folder.
Runs are created using settings specified in model_settings and
is formatted for inclusion in a document.
run_retro(mydir, model_settings, skipruns = FALSE)Directory where model files are located.
There is no default entry for mydir.
An example of user input could be
mydir = file.path("C:/my_models", "base_model").
A list of all model settings. Typically, created using get_settings but users can create their own list, as long as it has all of the necessary components for the function at hand.
Skip the steps where models are run and files are renamed. This facilitates reloading the results and makeing plots after manually replacing some of the model output.
Nothing is explicitly returned from retro_wrapper.
The following objects are saved to the disk.
mohnsrho.csv with the following columns:
type: the type of Mohn's rho
Woods Hole Mohn's rho (Legault 2009) used by the Northeast Fisheries Science Center (NEFSC), and
Hurtado-Ferro et al. (2015) used by the Alaska Fisheries Science Center (AFSC)
Quantity: the stock assessment quantity of interest
values: the Mohn's rho values
A set of figures from r4ss::SSplotComparisons
retrofigures4doc.csv for use with sa4ss::add_figure to add retro peels of
spawning stock biomass (SSB) and fraction unfished,
complete with captions and alternative text.
apply(utils::read.csv(file.path("..", paste0(mod_loc, "_retro"), "retrofigures4doc.csv")), 1, function(x) do.call(sa4ss::add_figure, as.list(x)))
mohnsrho.tex for use with sa4ss::read_child()
inside of an environment with results = "asis"
to include a table of Mohn's rho values in a document.
sa4ss::read_child(file.path(paste0(params[["model"]], "_retro"), "mohnsrho.tex"))
retro_output.Rdata with a list of R objects.
The following functions interact with retro_wrapper:
run_diagnostics: calls retro_wrapper
r4ss::retro: the workhorse of retro_wrapper that does the peels