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

Description Usage Arguments Details Value Which arguments to specifiy in case files Author(s) See Also Examples

View source: R/change_f.r

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

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

Arguments

years

*Vector of integers that will map to each fvals specifying which year the fishing level pertains to.

fisheries

*Vector of integers that will map to each fvals specifying which fleet the fishing level pertains to. A single value will be repeated for every value in years or length(years) == length(fisheries) must be true.

fvals

*Vector of F values to be entered into the SS control file. A single value will be repeated for every value in years or length(years) == length(fvals) must be true.

seasons

Vector of seasons to be entered into the SS control file. A single value will be repeated for every value in years or length(years) == length(ses) must be true. The default is 1, which will be applied to all fisheries in all years.

ses

Vector of fishing level standard errors (ses) to be entered into the SS control file. A single value will be repeated for every value in years or length(years) == length(ses) must be true. The default is 0.005, which will be applied to all fisheries in all years.

ctl_file_in

A string providing the path to the input SS .ctl file.

ctl_file_out

A string providing the path to the output SS control file. If the value is NULL, the file will not be written to the disk.

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.

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.

Author(s)

Kelli Faye Johnson

See Also

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

Examples

1
2
3
4
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"))

ss3sim documentation built on Nov. 9, 2019, 1:06 a.m.