Learn R Programming

ss3sim (version 1.0.3)

change_f: Alter fishing mortality (F) using the SS control file

Description

Alter fishing mortality (F) for a Stock Synthesis simulation via changes to the control file. The argument years is the only argument that must be a vector, where other vectors, e.g., fisheries, will be repeated if a single value is provided.

Usage

change_f(years, fisheries, fvals, seasons = 1, ses = 0.005,
  ctl_file_in, ctl_file_out = "control_fishing.ss")

Value

Modified SS control file.

Which arguments to specifiy in case files

All function argument descriptions that start with an asterisk (*) will be passed through the case files to run_ss3sim. If one of these arguments is not specified in a case file, then a value of NULL will be passed, which may or may not be an appropriate value. Other arguments will be ignored if specified.

Details

Using the control file depends on (1) the starter file is set up to read parameters from the control file rather than the par file and (2) the data file having a dummy catch entry for every year, fishery combination that will be specified in the control file. F values currently in the control file will be removed and the newly specified values will replace them. Users do not need to specify values for years in which there will be zero fishing because SS will be parameterized to assume no fishing in missing years.

The control file is currently read in using readLines but will eventually shift to using code specific to Stock Synthesis to alter a structured list. If used with run_ss3sim, the case file should be named F. A suggested (default) case letter is F.

See Also

Other change functions: change_data, change_em_binning, change_e, change_f_par, change_o, change_retro, change_tv

Examples

Run this code
# NOT RUN {
d <- system.file(file.path("extdata", "models"), package = "ss3sim")
change_f(years = 1:50, fisheries = 1, fvals = 0.2,
  ctl_file_in = file.path(d, "cod-om", "codOM.ctl"),
  ctl_file_out = file.path(tempdir(), "control_fishing.ss"))
# }

Run the code above in your browser using DataLab