Description Usage Arguments Details Value Author(s) Examples
This function verifies the contents of operating model (om
) and
estimation model (em
) folders (i.e., it checks that the necessary SS
input files are available). If the contents are correct, the
.ctl
and .dat
files are renamed to standardized names and the
starter.ss
file is updated to reflect these names. If the contents
are incorrect then a warning is issued and the simulation is aborted.
1 | verify_input(model_dir, type = c("om", "em"))
|
model_dir |
Directory name for model. This folder should contain the
|
type |
One of "om" or "em" for operating or estimating model. |
This is a helper function to be used within the larger wrapper simulation functions.
Returns a version of the folder with sanitized files or an error if some files are missing.
Curry James Cunningham; modified by Sean Anderson
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Create a temporary folder for the output:
temp_path <- file.path(tempdir(), "ss3sim-verify-example")
dir.create(temp_path, showWarnings = FALSE)
d <- system.file("extdata", package = "ss3sim")
om <- paste0(d, "/models/cod-om")
em <- paste0(d, "/models/cod-em")
file.copy(om, temp_path, recursive = TRUE)
file.copy(em, temp_path, recursive = TRUE)
# Verify the correct files exist and change file names:
verify_input(model_dir = paste0(temp_path, "/cod-om"), type = "om")
verify_input(model_dir = paste0(temp_path, "/cod-em"), type = "em")
unlink(temp_path, recursive = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.