Get Fishery and Survey Selectivity Plots
get_selex_plot.RdGenerates age- or length-based selectivity plots for all fishery and survey fleets across one or more SPoRC model runs. Selectivity curves are faceted by sex, region, and fleet, and coloured by year when multiple years are requested, allowing visualisation of time-varying selectivity alongside model comparisons.
Arguments
- rep
List of length
n_models, where each element is a SPoRC report list (i.e. the output ofobj$report()after optimisation). Must containfish_selandsrv_sel(age-based) and/orfish_sel_landsrv_sel_l(length-based) depending onSelex_Type.- model_names
Character vector of length
n_modelsgiving display names for each model run. Used as the linetype legend label.- Selex_Type
Character string specifying whether to plot age- or length-based selectivity. One of
"age"(default) or"length". Must match theSelex_Typeused when fitting the model (i.e.fish_sel_l/srv_sel_lare only populated whenSelex_Type = 1in the model).- year_indx
Integer or integer vector of year indices to include in the plot. When multiple years are supplied, curves are coloured by year on a continuous viridis scale, making time-variation in selectivity visible. If
NULL(default), only the terminal year is plotted.
Value
A list of two ggplot objects:
- [[1]] fish_sel_plot
Fishery selectivity curves faceted by Sex × (Region + Fleet). Lines are coloured by year and distinguished by linetype across models.
- [[2]] srv_sel_plot
Survey selectivity curves with identical faceting and aesthetic structure as the fishery plot.
See also
Other Plotting:
get_biological_plot(),
get_data_fitted_plot(),
get_ts_plot(),
plot_all_basic(),
theme_sablefish()
Examples
if (FALSE) { # \dontrun{
# Terminal year only
plots <- get_selex_plot(list(rep1, rep2), c("Base", "Sensitivity"))
# All years to visualise time-varying selectivity
plots <- get_selex_plot(list(rep1), "Base", Selex_Type = "age", year_indx = 1:40)
plots[[1]] # fishery selectivity
plots[[2]] # survey selectivity
} # }