Manipulates the control list to simultaneously add and remove elements related to time series data on trends.

change_q(
  string_add = NULL,
  string_remove = NULL,
  ctl_list,
  dat_list = lifecycle::deprecated(),
  ctl_file_in = lifecycle::deprecated(),
  dat_file_in = lifecycle::deprecated(),
  ctl_file_out = lifecycle::deprecated(),
  overwrite = lifecycle::deprecated(),
  verbose = lifecycle::deprecated()
)

Arguments

string_add

A vector of fleet names and/or integers representing fleets that need \(q\) parameters added to the control file.

string_remove

A vector of fleet names and/or integers representing fleets that need \(q\) parameters removed from the control file.

ctl_list

A control file read in by SS_readctl.

dat_list

Deprecated with ss3sim version 1.19.1 because users can obtain fleet information from ctl_list.

ctl_file_in

Deprecated with ss3sim version 1.19.1 because users can pass list as read in by r4ss::SS_readctl() rather than specifying the file name to be read in.

dat_file_in

Deprecated with ss3sim version 1.19.1 because users can pass list as read in by r4ss::SS_readdat() rather than specifying the file name to be read in.

ctl_file_out

Deprecated with ss3sim version 1.19.1 because ss3sim uses the returned list internally rather than the saved control file.

overwrite

Deprecated with ss3sim version 1.19.1 because the file is no longer being saved to the disk. So, there is nothing to overwrite.

verbose

Deprecated with ss3sim version 1.19.1 because all messages were removed.

Value

A modified Stock Synthesis control list.

Details

Catchability, \(q\), represents the proportionality constant between data on trends and estimated population abundance. Thus a survey thought to encapsulate the entire population, e.g., an acoustic survey of the entire area, will have \(q = 1\). In Stock Synthesis, environmental time series are modelled similarly to a survey or catch-per-unit-effort time series and thus will also have a catchability term. Readers interested in the complete range of functionality should see the catchability section of the Stock Synthesis user manual. change_q() has limited functionality relative to what is available in Stock Synthesis. For example, change_q() cannot add parameters for additional variance. Though it will remove additional variance parameters for fleets that no longer have survey data. Additionally, the float term is not used within ss3sim and is set to zero.

See also

Author

Kelli F. Johnson

Examples

removedfleet1 <- change_q(string_remove = 1, ctl_list = codomctl)
removedfleet2 <- change_q(string_remove = 2, ctl_list = codomctl)
removedfleets <- change_q(
  string_remove = c("Fishery", 2),
  ctl_list = codomctl
)
testthat::expect_null(removedfleets[["Q_options"]])
newctl <- codomctl
newctl[["fleetnames"]] <- c(newctl[["fleetnames"]], "testfleet")
newctl[["Nfleets"]] <- length(newctl[["fleetnames"]])
newctl <- change_q(string_add = "testfleet", ctl_list = newctl)
testthat::expect_equal(newctl[["Q_options"]][, "fleet"], 1:3)