Description Usage Arguments Details Value Author(s) Examples
View source: R/change_rec_devs.r
This function replaces the recruitment deviations in the
control file of a Stock Synthesis model with those specified in the argument
recdevs
. The new control file is then written to the disk if
ctl_file_out
is specified.
It is imperative that the path provided in ctl_file_in
be to a ss_new
file so change_rec_devs
can
properly determine where to place the recruitment deviations
in the control file.
1 2 | change_rec_devs(recdevs, ctl_file_in,
ctl_file_out = "control_recruitment.ss")
|
recdevs |
A vector of recruitment deviations to be entered into
the SS control file. The vector must be the same length as the vector
of recruitment deviations that are commented out in the |
ctl_file_in |
A string providing the path to the input SS |
ctl_file_out |
A string providing the path to the output SS control file. If the value is |
This function does not need to be specified in a case file if you
are running an ss3sim simulation using run_ss3sim
.
A modified SS control file.
Kelli Faye Johnson
1 2 3 4 5 6 7 8 9 | d <- system.file(file.path("extdata", "models"), package = "ss3sim")
change_rec_devs(recdevs = rlnorm(101),
ctl_file_in = file.path(d, "cod-om", "codOM.ctl"),
ctl_file_out = file.path(tempdir(), "control_recdevs.ss"))
# Change the recruitment deviations in years 2:11
change_rec_devs(recdevs = setNames(rlnorm(10), 2:11),
ctl_file_in = file.path(d, "cod-om", "codOM.ctl"),
ctl_file_out = file.path(tempdir(), "control_recdevsInitial.ss"))
sapply(dir(tempdir(), pattern = "control_.+ss", full.names = TRUE), unlink)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.