View source: R/utils-update-ss3-maturity.R
update_ss3_maturity | R Documentation |
Update maturity in an SS3 weight-at-age matrix
update_ss3_maturity(
maturity,
weight_at_age,
ages = 0:15,
weight_at_age_fleet = 0
)
maturity |
A data frame of maturity at age. The data frame must
have at least three columns, |
weight_at_age |
A data frame of weight-at-age values as returned from
|
ages |
An integer vector specifying which ages must be present. All missing combinations of ages and year will be filled in with a probability of being mature of 0.0. This is helpful when there are no values for age-0 fish in the data frame for a given year. |
weight_at_age_fleet |
An integer specifying which fleet you want to take the weight-at-age information from. The default is 0, which is the beginning of the year population-level weight-at-age data. |
Update the maturity information (i.e., fleet == -2
) in a matrix of
weight-at-age data read in using r4ss::SS_readwtatage()
. Information for
the fleets other than fleet -2 will not be altered. The information from
fleet 0 (i.e., beginning of the season population weight-at-age) is used to
create the fecundity information. This can be changed by altering the
default value for the weight_at_age_fleet
argument.
The input data frame for maturity
need not contain all years available
in weight_at_age
. The last year available will be the last year before
a five-year average is taken for the forecast years. The remaining missing
years will be filled in using a global average of the available data.
Typically, all fleets other than fleet -2 have the same information but in
case they do not, then the population information seems to be the best to
create fecundity.
A data frame with the same format as the input data frame for weight_at_age
is returned, and thus, the returned object can be passed to
r4ss::SS_writewtatage()
.
Kelli F. Johnson
## Not run:
# The following example does not actually work because the path to the
# weight-at-age file does not exist.
update_ss3_maturity(
maturity = maturity_estimates_df |>
dplyr::filter(model == "Null"),
weight_at_age = r4ss::SS_readwtatage("wtatage.ss")
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.