pad_weight_at_age: Fill in necessary years of weight-at-age file

View source: R/utils-pad-weight-at-age.R

pad_weight_at_ageR Documentation

Fill in necessary years of weight-at-age file

Description

Fill in necessary years of weight-at-age file

Usage

pad_weight_at_age(
  data,
  n_forecast_years = 5,
  n_years_used_for_forecast = 5,
  year_global_average = -1940,
  ages = 0:20
)

Arguments

data

A data frame of weight-at-age data in long form where the weight-at-age information is stored in a column called pred_weight, the four-digit year is in a column called year, and integer ages are in a column called age.

n_forecast_years

An integer specifying the number of forecast years you want to extend the time series by.

n_years_used_for_forecast

An integer specifying the number of years of data that you want to average over for the forecast period.

year_global_average

A four digit integer, typically -1940, that is used to delineate the equilibrium year, all years after this and prior to the first year of data will be filled in by the information stored in this row.

ages

A vector of integers specifying the ages you want in your file. If there are no ages in the data to represent the older ages present in vector, then the information for the oldest age will be repeated for any given year.

Details

Note that this function can also be used to pad maturity information such that it has the same format as the weight-at-age information allowing for the multiplication of maturity by weight at age to get fecundity.

Value

A data frame of weight-at-age information is returned that can immediately be passed to r4ss::SS_writewtatage().

Author(s)

Kelli F. Johnson


pacific-hake/hake-assessment documentation built on Nov. 8, 2024, 1:16 p.m.