Change the composition data in a Stock Synthesis data list object or file to include rows of data that are desired. Typically, this will be an operating model (OM) because only dummy-data observations are used here, i.e., all compositions are set to a value of one. Creating these dummy observations is helpful before running your OM because it will facilitate the creation of observed values for each desired combination.

change_comp(dat_list, type = c("len", "age", "cal"), paramlist, nsex = 1, bins)

Arguments

dat_list

A Stock Synthesis data list object as read in from SS_readdat. Be sure to correctly specify which section of the data file you want to work with when reading it in using the section argument. Where, section = 1 reads in the input values used to run the model and section = 2 reads in the expected values generated given all the input to the OM. section = 3 is not used within ss3sim, but this section provides bootstrapped data sets that have been sampled internally within SS.

type

The sample type you want. See the function call for available types, e.g., formals(change_comp)$type; the first value will be used as the default if user input is not provided.

paramlist

A list of parameter values derived from the data frame used to set up your similation. For example, setup_scenarios(setup_scenarios_defaults())[[1]] will give you defaults that you can extract from. Typically, mylist[[c("agecomp_params", "lcomp_params")]] are passed. Make sure that you only pass the portion of the list that pertains to the data you want.

nsex

An integer value between one and two specifying the number of sexes in the model, where 1 is based on females only for spawning stock biomass and two-sex models allow for sex-specific parameters.

bins

A vector of bins for the composition data. The bins do not need to be named because they will be renamed with their value and a leading character based on what type of data they are.

Examples

# todo: remove this example when testing is complete
if (FALSE) { # \dontrun{
change_comp(
  dat_list = dat, type = "len",
  paramlist = scenariol[[1]][[c("lcomp_params", "agecomp_params")]]
)
} # }