#' Create and/or load RDS file contents from multiple MSE runs
#'
#' @param scenarios A vector of directory names inside the results
#' directory with MSE results
#' @param overwrite_rds If TRUE, all RDS files will be re-created (takes
#' a long time). If FALSE, the files that exists will be loaded and returned
#' @param om_only A vector of logicals of the same length as `scenarios`
#' indicating if the run is an OM only run (TRUE) or a full MSE with EM
#' estimation (FALSE)
#' @param ... Arguments to pass to [load_mse_plot_data()]
#'
#' @return A list of length of `scenarios` containing MSE output data
#' @export
create_plot_objects <- function(scenarios = c("biasadjust",
"climate",
"hcr",
"selectivity"),
om_only = rep(FALSE, length(scenarios)),
overwrite_rds = TRUE,
...){
ps <- future_map2(scenarios, om_only, \(scen = .x,
om_only = .y,
overwrite_rds = overwrite_rds,
...){
lst <- load_mse_plot_data(scenario = scen,
overwrite_rds = overwrite_rds,
om_only = om_only,
...)
if(overwrite_rds){
cat(green(symbol$tick),
green(" Created and loaded plot objects for scenario:", scen, "\n"))
}else{
cat(green(symbol$tick),
green(" Loaded plot objects for scenario:", scen, "\n"))
}
lst
}, overwrite_rds, ...)
names(ps) <- scenarios
invisible(ps)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.