copy_ss3models function

Copy the operating and estimation models and create a folder structure

Copy the operating and estimation models and create a folder structure

copy_ss3models(model_dir, scenarios, iterations = 1:100, type = c("om", "em"))

Arguments

  • model_dir: A directory containing the operating or estimation model. Each folder should be named according to a scenario ID. (See the vignette vignette("ss3sim-vignette") or get_caseargs for details on the scenario ID format.)
  • scenarios: Which scenarios to copy to. Supply a vector of character elements.
  • iterations: A numeric vector of the iterations to copy to. The function will create the folders as needed.
  • type: Are you copying operating or estimation models? This affects whether the model folder gets named "om" or "em"

Returns

An invisible boolean for whether that iteration already existed. A set of nested folders starting with the scenario ID, then the iterations, then "om" or "em", and then the SS model files.

Examples

# Locate the package data: om_folder <- system.file("extdata", "models", "cod-om", package = "ss3sim") # Copy the operating model: copy_ss3models(model_dir = om_folder, type = "om", iterations = 1:3, scenarios = "D0-F0-testing") # Now look at your working directory in your file system # Copy the estimation model with two scenario IDs: copy_ss3models(model_dir = om_folder, type = "em", iterations = 1:2, scenarios = c("D1-F0-testing", "D2-F0-testing")) # (Note that all the scenario argument does here is affect the # folder names.) # Clean up: unlink("D0-F0-testing", recursive = TRUE) unlink("D1-F0-testing", recursive = TRUE) unlink("D2-F0-testing", recursive = TRUE)

Author(s)

Sean Anderson, Kelli Johnson

  • Maintainer: Kelli F. Johnson
  • License: MIT + file LICENSE
  • Last published: 2019-11-08