plot_selex_mcmc: Plot MCMC selectivities for iSCAM models

View source: R/plot-selex-mcmc.R

plot_selex_mcmcR Documentation

Plot MCMC selectivities for iSCAM models

Description

Plot the selectivity for any combination of gears in an iscam model

Usage

plot_selex_mcmc(
  model,
  gear = NULL,
  probs = c(0.025, 0.5, 0.975),
  show_maturity = FALSE,
  ages = as.character(model$dat$start.age:model$dat$end.age),
  breaks = seq(0, model$dat$end.age, 5),
  ci_type = c("both", "line", "ribbon"),
  ci_linetype = c("dotted", "solid", "dashed", "dotdash", "longdash", "twodash"),
  ci_alpha = 0.3,
  leg_loc = c(1, 1),
  angle_x_labels = FALSE
)

Arguments

model

An iscam model object (class mdl_cls)

gear

A gear number to plot

probs

A 3-element vector of probabilities that appear in the output data frames This is provided in case the data frames have more than three different quantile levels

show_maturity

If TRUE, overlay the maturity ogive on the selectivity plots

ages

A character vector from 1 to the maximum age to show on the plot. Defaults to the max age in the model. This may be needed when The selectivity goes past the maximum age, so that we may see the selectivity curve

breaks

A vector representing the tick locations on the x-axis

ci_type

One of "line", "ribbon", "both" to show the credible interval

ci_linetype

See linetype in ggplot2. Only used if ci_type is "line" or "both"

ci_alpha

Opacity between 0 and 1 for the credible intervals ribbons. Only used if ci_type is "ribbon" or "both"

leg_loc

A two-element vector describing the X-Y values between 0 and 1 to anchor the legend to. eg. c(1, 1) is the top right corner and c(0, 0) is the bottom left corner. It can also be the string "facet" in which case the legend will appear in the empty facet if it exists.

angle_x_labels

If TRUE put 45 degree angle on x-axis tick labels

Value

A ggplot2::ggplot() object

See Also

Other Selectivity plotting functions: plot_selex_gear_mcmc(), plot_selex_mpd(), plot_tv_selex_mpd()


pbs-assess/gfiscamutils documentation built on Oct. 24, 2024, 1:37 p.m.