plot_expanded: plot_expanded is makes plots of the expanded bycatch...

View source: R/plot_expanded.R

plot_expandedR Documentation

plot_expanded is makes plots of the expanded bycatch estimates, accounting for observer coverage and effort

Description

plot_expanded is makes plots of the expanded bycatch estimates, accounting for observer coverage and effort

Usage

plot_expanded(
  fitted_model,
  xlab = "Time",
  ylab = "Events",
  show_total = TRUE,
  include_points = FALSE
)

Arguments

fitted_model

Data and fitted model returned from estimation

xlab

X-axis label for plot

ylab

Y-axis label for plot

show_total

Whether to show the total predicted bycatch (by default, this is TRUE) or just the expanded unobserved events (=FALSE)

include_points

whether or not to include raw bycatch events on plots, defaults to FALSE

Value

plot called from ggplot

Examples


d <- data.frame(
  "Year" = 2002:2014,
  "Takes" = c(0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0),
  "expansionRate" = c(24, 22, 14, 32, 28, 25, 30, 7, 26, 21, 22, 23, 27),
  "Sets" = c(391, 340, 330, 660, 470, 500, 330, 287, 756, 673, 532, 351, 486)
)
fit <- fit_bycatch(Takes ~ 1,
  data = d, time = "Year",
  effort = "Sets",
  family = "poisson",
  expansion_rate = "expansionRate",
  time_varying = FALSE
)
plot_expanded(
  fitted_model = fit,
  xlab = "Year",
  ylab = "Fleet-level bycatch",
  include_points = TRUE
)


eric-ward/bycatch documentation built on July 5, 2023, 4:37 p.m.