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()
)
A vector of fleet names and/or integers representing fleets that need \(q\) parameters added to the control file.
A vector of fleet names and/or integers representing fleets that need \(q\) parameters removed from the control file.
A control file read in by SS_readctl
.
Deprecated with ss3sim version 1.19.1 because users can
obtain fleet information from ctl_list
.
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.
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.
Deprecated with ss3sim version 1.19.1 because ss3sim uses the returned list internally rather than the saved control file.
Deprecated with ss3sim version 1.19.1 because the file is no longer being saved to the disk. So, there is nothing to overwrite.
Deprecated with ss3sim version 1.19.1 because all messages were removed.
A modified Stock Synthesis control list.
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.
check_q()
determines which fleets should removed or added.
r4ss::SS_readctl()
reads in the control file passed to ctl_list
.
find_position()
allows string_*
to use strings or integers.
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)