plot.tag.returns.time.v2: Plot the observed and predicted tag recaptures.

View source: R/plot.tag.returns.v2.R

Plot tag returns timeR Documentation

Plot the observed and predicted tag recaptures.

Description

Plot the observed and predicted tag recaptures by tag recapture group. Tags caught during the mixing period are not counted. The plot is either a time series of the difference between the observed and predicted, or a time series of the recaptures. A loess smoother is put through the differences.

Usage

plot.tag.returns.time.v2(
  tagrelease.list,
  tagrep.list,
  names = NULL,
  fishery.map,
  recapture.groups,
  plot.diff = TRUE,
  scale.diff = TRUE,
  show.legend = TRUE,
  show.points = FALSE,
  palette.func = default.model.colours,
  save.dir,
  save.name,
  ...
)

prepare.tag.returns.time.v2(
  tagrelease.list,
  tagrep.list,
  names = NULL,
  fishery.map,
  plot.diff = TRUE,
  scale.diff = TRUE,
  show.legend = TRUE,
  show.points = FALSE,
  palette.func = default.model.colours,
  save.dir,
  save.name,
  ...
)

generate.plot.tag.returns.time.v2(
  pdat,
  model_names = unique(pdat$Model),
  recapture.groups,
  plot.diff = TRUE,
  scale.diff = TRUE,
  show.legend = TRUE,
  show.points = FALSE,
  palette.func = default.model.colours,
  save.dir,
  save.name,
  ...
)

Arguments

tagrelease.list

A list, or an individual data.frame, of tag release data created by the tag.release.data.preparation() function.

tagrep.list

A list, or an individual data.frame, of tag returns from the temporary_tag_returns file. The output from the FLR4MFCL function read.temporary_tag_report().

names

A vector of character strings naming the models for plotting purposes. If not supplied, model names will be taken from the names in the tagrelease.list (if available) or generated automatically.

fishery.map

A data.frame that describes which fishery is fishing in which region and with which gear. The columns are: fishery_name, region, gear, fishery (the reference number), tag_recapture_group and tag_recapture_name. The map should contain entries for all fisheries to avoid data being inadvertently dropped.

recapture.groups

A vector of the reference numbers of the tag recapture groups you want to plot.

plot.diff

Do you want to plot the difference between the observed and predicted, or a time series of recaptures? TRUE (default) or FALSE.

scale.diff

If TRUE, the difference between observed and predicted is scaled by the mean of observed returns.

show.legend

Do you want to show the plot legend, TRUE (default) or FALSE.

show.points

Do you want to show points as well as the smoother for the difference plots? Default is FALSE.

palette.func

A function to determine the colours of the models. The default palette has the reference model in black. It is possible to determine your own palette function. Two functions currently exist: default.model.colours() and colourblind.model.colours().

save.dir

Path to the directory where the outputs will be saved

save.name

Name stem for the output, useful when saving many model outputs in the same directory

...

Passes extra arguments to the palette function. Use the argument all.model.names to ensure consistency of model colours when plotting a subset of models.

pdat

The output from calling prepare.plot.tag.returns.time.v2

model_names

Names of the models to be plotted and ordered by.


PacificCommunity/ofp-sam-diags4MFCL documentation built on Oct. 11, 2023, 1:32 a.m.