# NOT RUN {
# Create a temporary folder for the output and set the working directory:
temp_path <- file.path(tempdir(), "ss3sim-tv-example")
dir.create(temp_path, showWarnings = FALSE)
wd <- getwd()
setwd(temp_path)
on.exit(setwd(wd), add = TRUE)
d <- system.file("extdata", package = "ss3sim")
om <- file.path(d, "models", "cod-om")
dir.create("cod-om")
file.copy(om, ".", recursive = TRUE)
setwd("cod-om")
change_tv(change_tv_list =
list("NatM_p_1_Fem_GP_1" = c(rep(0, 20), rep(.1, 80)),
"SR_BH_steep"=rnorm(100, 0, 0.05)),
ctl_file_in = "codOM.ctl",
ctl_file_out = "example.ctl",
dat_file_in = "codOM.dat",
dat_file_out = "example.dat")
# Clean up:
unlink("cod-om", recursive = TRUE)
# }
Run the code above in your browser using DataLab