Skip to contents

Convert length frequencies to age frequencies by slicing using cohort-based age-length relationships.

Usage

get_sliced_afs(data, lf_data)

Arguments

data

A list containing model data passed to MakeADFun. Must include: n_lf (integer, number of length frequency observations), n_age (integer, number of age classes), age_a (numeric vector of age classes), lf_year (integer vector of years), lf_season (integer vector of seasons), and length_mu_ysa (3D array of mean length-at-age by year, season, and age).

lf_data

A data.frame containing length frequency data. Must include columns for Fishery, Year, N, and additional columns representing length bins with numeric column names.

Value

A list with two components:

lf_slices

A matrix of dimensions n_lf x (number of length bins) containing the age bin assignments for each length bin.

af_sliced

A matrix of dimensions n_lf x n_age containing the sliced age frequencies, with column names corresponding to age classes.