Skip to contents

Plots observed survey and fishery indices alongside model-predicted values for one or more SPoRC model runs. Observed values are shown as points with approximate 95 lines coloured by model. Years where the observed index is zero (i.e. Use*Idx = 0) are excluded from both the points and lines.

Usage

get_idx_fits_plot(data, rep, model_names)

Arguments

data

List of length n_models, where each element is a SPoRC data list. Passed to get_idx_fits along with rep[[i]]; year labels are taken from data[[i]]$years.

rep

List of length n_models, where each element is a SPoRC report list (i.e. the output of obj$report() after optimisation). Predicted index values are extracted internally via get_idx_fits.

model_names

Character vector of length n_models giving display names for each model run. Used as the colour legend label on predicted trajectories.

Value

A single ggplot object. Observed indices are shown as geom_pointrange (black) with lower and upper confidence interval bounds from get_idx_fits. Predicted indices are shown as geom_line coloured by model.

Examples

if (FALSE) { # \dontrun{
  get_idx_fits_plot(
    data        = list(data1, data2),
    rep         = list(rep1, rep2),
    model_names = c("Base", "Sensitivity")
  )
} # }