plot_index: Plot sampled survey index or catch projections

View source: R/figures-index.R

plot_indexR Documentation

Plot sampled survey index or catch projections

Description

  • plot_index(): Plots observed and simulated indices, i.e., MSE@PPD[[i]]@Ind or MSE@PPD[[i]]@AddInd, gridded by OM and MP

  • plot_scenario_index(): Plots observed and simulated indices, i.e., MSE@PPD[[i]]@Ind or MSE@PPD[[i]]@AddInd by MP (multiple OMs per panel)

  • plot_catch(): Plots observed catches, i.e., MSE@PPD[[i]]@Cat. To plot OM catches, use plot_scenario_catch().

Usage

plot_index(
  object_list,
  n_samples = 4,
  seed = 42,
  type = c("Ind", "AddInd"),
  MP = NULL,
  omit_index_fn = function(x) NULL,
  quantiles = c(0.025, 0.975),
  french = isTRUE(getOption("french"))
)

plot_scenario_index(
  object_list,
  seed = 42,
  type = c("Ind", "AddInd"),
  MP = NULL,
  omit_index_fn = function(x) NULL,
  quantiles = c(0.025, 0.975),
  palette = "Dark2",
  french = isTRUE(getOption("french"))
)

plot_catch(
  object_list,
  n_samples = 4,
  seed = 42,
  MP = NULL,
  quantiles = c(0.025, 0.975),
  french = isTRUE(getOption("french"))
)

Arguments

object_list

A list of MSEtool MSE objects representing different scenarios. The list should be named with the scenario names.

n_samples

The number of timeseries samples to illustrate.

seed

The seed to set before drawing samples.

type

Which index to plot.

MP

A character vector to subset the management procedures in the MSE object.

omit_index_fn

A function that indexes years in the projection period to omit from the plot. E.g., for a biennial survey omitting even years starting in year 2: ⁠function(x) seq(2, x, 2))⁠. x represents the total number of years.

quantiles

Probability quantiles to show.

french

French?

palette

A palette color as recognized by ggplot2::scale_color_brewer()

Value

A ggplot object

Examples

plot_index(mse_example)
mse_list <- list()
mse_list[[1]] <- mse_example
mse_list[[2]] <- mse_example
names(mse_list) <- c("Sc 1", "Sc 2")
plot_index(mse_list)

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