tidy_caa: Generate length-at-age or catch-at-age data

View source: R/utils.R

tidy_calR Documentation

Generate length-at-age or catch-at-age data

Description

Generate length-at-age or catch-at-age data

Usage

tidy_cal(dat, yrs, unsorted_only = TRUE, interval = 1, sex = c(1, 2))

tidy_caa(dat, yrs, unsorted_only = FALSE, interval = 1, sex = c(1, 2))

Arguments

dat

Commercial or biological samples from get_commercial_samples() or get_survey_samples().

yrs

A complete set of years to include in the matrix.

unsorted_only

Logical for whether to only include the unsorted samples. Only applies to the commercial data.

interval

Interval for the complete set of ages or lengths. For example, for length bins of interval 2, interval = 2.

sex

Numeric vector indicating males and/or or females.

Value

A catch at age or catch at length matrix as an array. 1 x nyears x nage/nlength

Examples

## Not run: 
d_commercial <- gfdata::get_commercial_samples(222)
cal <- tidy_cal(d_commercial, yrs = 2005:2010, interval = 5)

d_survey <- gfdata::get_survey_samples(222, ssid = 1)
caa <- tidy_caa(d_survey, yrs = 2010:2012)
caa[1, , ]

## End(Not run)

pbs-assess/ggmse documentation built on Nov. 21, 2023, 8:06 p.m.