Set up the bin structure needed for composition data.

setup_bins(bins, nsex = 1, leader = c("l", "a"))

Arguments

bins

A vector of integer values, either lengths or ages. Do not repeat them if you are using a two-sex model, the function will do that for you.

nsex

A single integer of one or two specifying the number of sexes in the model.

leader

Most users will not need to change the leader character from the default unless you are working with age data, then just use \code"a" rather than the default of "l". If you have a two-sex model, i.e., nsex = 2, then the function will take care of the naming for you, which is forced to "f" and "m". You can change them afterwards if you want.

See also

This is a helper function used to create the bins before sampling takes place, see ss3sim_base().

Examples

ex <- setup_bins(bins = 1:10, nsex = 2, leader = "a")
test <- length(ex) == 20 & all(grep("m", ex) == 11:20)
ex <- setup_bins(bins = 1:5, nsex = 1)
test <- ex[4] == "l4"