Learn R Programming

ss3sim (version 0.9.0)

change_rec_devs: Replace recruitment deviations

Description

This function replaces the recruitment deviations in the ss3.par file with those specified in recdevs_new, as well as a comment (for debugging). It then writes a new file with name par_file_out into the working directory.

Usage

change_rec_devs(recdevs_new, par_file_in = "ss3.par",
  par_file_out = "ss3.par")

Arguments

recdevs_new
A vector of new recruitment deviations.
par_file_in
A string providing the path to the input SS3 .par file.
par_file_out
A string providing the path to the output SS3 .par file.

Value

  • A modified SS3 .par file.

Details

This function does not need to be specified in a case file if you are running and ss3sim simulation through case files with run_ss3sim.

Examples

Run this code
# Create a temporary folder for the output:
temp_path <- file.path(tempdir(), "ss3sim-recdev-example")
dir.create(temp_path, showWarnings = FALSE)

par_file <- system.file("extdata", "models", "cod-om", "ss3.par",
  package = "ss3sim")
change_rec_devs(recdevs_new = rlnorm(100), par_file_in = par_file,
  par_file_out = paste0(temp_path, "/test.par"))

Run the code above in your browser using DataLab