split_catch_maturity: Split catch densities by mass ratio of maturity classes

View source: R/split-by-maturity.R

split_catch_maturityR Documentation

Split catch densities by mass ratio of maturity classes

Description

Split catch densities by mass ratio of maturity classes

Usage

split_catch_maturity(
  survey_sets,
  fish,
  split_dens_type = "density_kgpm2",
  survey = c("SYN HS", "SYN QCS", "SYN WCVI", "SYN WCHG"),
  years = NULL,
  cutoff_quantile = 0.9995,
  p_threshold = 0.5,
  use_median_ratio = TRUE,
  sample_id_re = TRUE,
  year_re = FALSE,
  plot = FALSE
)

Arguments

survey_sets

Data from gfdata::get_survey_sets().

fish

Data from gfdata::get_survey_samples().

split_dens_type

Which density type will be split and saved as a column providing units for adult_density and imm_density columns.

survey

List of survey abbreviations.

years

List of years. Default 'NULL' includes all years.

cutoff_quantile

Set max cutoff quantile for mass modeled from lengths.

p_threshold

Probability of maturity to split at. Default = 0.5. Alternatives are 0.05 or 0.95.

use_median_ratio

If TRUE, uses median proportion mature (if FALSE uses mean proportion mature) when catch too small to have biological samples collected.

sample_id_re

If TRUE then the model will include random intercepts for sample ID.

year_re

Option to have lengths at maturity vary by year, but this requires the gfvelocities package.

plot

Logical for whether to produce plots (length-weight and length-at-maturity relationships).

Examples

## Not run: 
d_survey_sets <- gfdata::get_survey_sets("pacific cod")
d_survey_samples <- gfdata::get_survey_samples("pacific cod")

d_by_maturity <- split_catch_maturity(
  d_survey_sets, d_survey_samples,
  survey = c("SYN HS", "SYN QCS"),
  years = NULL,
  plot = TRUE
)

## End(Not run)

seananderson/pbs-synopsis documentation built on April 4, 2024, 1:36 p.m.