Verify the contents of
operating model (OM
) and
estimation model (EM
) folders, i.e.,
check that the necessary Stock Synthesis 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.
verify_input(model_dir, type = c("om", "em"))
Nothing is returned from this function. Instead, file are changed and saved to the disk.
# 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", "models", package = "ss3sim")
om <- file.path(d, "cod-om")
em <- file.path(d, "cod-em")
file.copy(om, temp_path, recursive = TRUE)
#> [1] TRUE
file.copy(em, temp_path, recursive = TRUE)
#> [1] TRUE
# Verify the correct files exist and change file names:
verify_input(model_dir = file.path(temp_path, "cod-om"), type = "om")
verify_input(model_dir = file.path(temp_path, "cod-em"), type = "em")
unlink(temp_path, recursive = TRUE)