Check a Stock Synthesis control file to determine if the desired fleets have q parameters set up.

check_q(ctl_list, Nfleets = lifecycle::deprecated(), desiredfleets)

Arguments

ctl_list

A control file read in by SS_readctl.

Nfleets

Deprecated with ss3sim version 1.19.1 because the number of fleets is available in ctl_list.

desiredfleets

A numeric vector specifying which fleets should have catchability parameters.

Value

A list with two vectors, add and remove, specifying which fleets to add and which to remove from the control file.

See also

change_q() for actually adding or removing the fleets.

Examples

# Keep just the fishery
stopifnot(check_q(ctl_list = codomctl, desiredfleets = 1)[["remove"]] == 2)
# All elements of the returned list should be NULL
# because the model only has two \eqn{q} parameters
stopifnot(all(mapply(is.null, check_q(codomctl, desiredfleets = 1:2))))
# Fleet 3 is not present
stopifnot(check_q(codomctl, desiredfleets = 1:3)[["add"]] == 3)
stopifnot(check_q(codomctl, desiredfleets = 2:3)[["remove"]] == 1)