Skip to contents

Plot selectivity by fishery, year, and age.

Usage

plot_selectivity(
  fit = NULL,
  object = NULL,
  posterior = FALSE,
  probs = NULL,
  years = NULL,
  fisheries = c("LL1", "LL2", "LL3", "LL4", "Indonesian", "Australian", "CPUE",
    "CPUE index"),
  data = NULL,
  ...
)

Arguments

fit

An sbt_fit object. This diagnostic displays the fitted point estimate and does not materialize stored MCMC selectivity arrays.

object

Legacy RTMB objective used only with a legacy data-list input.

posterior

Deprecated. Posterior selectivity arrays are not generated by this plot because their size is prohibitive; non-FALSE inputs are ignored with a warning.

probs

Deprecated posterior interval probabilities. Non-NULL inputs are ignored with a warning.

years

A numeric vector specifying the years to display on the plot. Default NULL displays the configured selectivity-change years for the requested fisheries.

fisheries

A character vector specifying the fisheries to display. "CPUE" is the backward-compatible name for the dedicated row-7 selectivity used by CPUE length frequencies. "CPUE index" displays the selectivity row selected by cpue_sel_fishery for the CPUE abundance index. When both use row 7 they are shown as one series.

data

Legacy named alias for a model data list; supply object as well.

...

Additional options passed to geom_density_ridges.

Value

A ggplot2 object displaying selectivity patterns.

Examples

fit <- sbt_example_fit()
#> Warning: Dependency versions differ: RTMBdist, TMB
#> Warning: Dependency versions differ: RTMBdist, TMB
plot_selectivity(fit, years = c(2017, 2020, 2022))