copy_ss3models: Copy the operating and estimation models and create a folder...

Description Usage Arguments Value Author(s) Examples

View source: R/copy_ss3models.r

Description

Copy the operating and estimation models and create a folder structure

Usage

1
2
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"

Value

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.

Author(s)

Sean Anderson, Kelli Johnson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# 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)

ss3sim documentation built on Nov. 9, 2019, 1:06 a.m.