Skip to contents

Plots residuals for all indices as boxplot (color coded by fleet) with a loess showing systematic trends over time. This function is from the package JABBA (Just Another Bayesian Biomass Assessment).

Usage

SSplotJABBAres(
  ss3rep,
  subplots = c("cpue", "len", "age", "size", "con")[1],
  seas = NULL,
  plot = TRUE,
  print = lifecycle::deprecated(),
  print_plot = FALSE,
  png = lifecycle::deprecated(),
  use_png = print_plot,
  pdf = lifecycle::deprecated(),
  use_pdf = FALSE,
  indexselect = NULL,
  miny = 3,
  col = NULL,
  pch = 21,
  lty = 1,
  lwd = 2,
  tickEndYr = TRUE,
  xlim = "default",
  ylim = "default",
  ylimAdj = 1.1,
  xaxs = "i",
  yaxs = "i",
  xylabs = TRUE,
  type = "o",
  legend = TRUE,
  legendlabels = "default",
  legendloc = "bottomleft",
  legendorder = "default",
  legendncol = 1,
  legendcex = 1,
  legendsp = 0.9,
  legendindex = NULL,
  pwidth = 6.5,
  pheight = 5,
  punits = "in",
  res = 300,
  ptsize = 10,
  cex.main = 1,
  plotdir = NULL,
  filenameprefix = "",
  par = list(mar = c(5, 4, 1, 1) + 0.1),
  verbose = TRUE,
  boxcol = grey(0.8, 0.5),
  new = TRUE,
  add = FALSE
)

Arguments

ss3rep

Stock Synthesis output as read by r4ss::SS_output()

subplots

string of type of data to plot:

  • "cpue" Index of abundance data

  • "len" Length-composition data

  • "age" Age-composition data

  • "size" Generalized size composition data

  • "con" Conditional age-at-length data.

seas

string indicating how to treat data from multiple seasons:

  • "comb" Combine seasonal data for each year and plot against Yr

  • "sep" Treat season separately, plotting against Yr.S.

  • NULL If NULL, it is assumed that there is only one season and option "comb" is used.

plot

DEPRECATED. By default, TRUE, Plots (and subplots) are drawn to the plot device. The option to explicitly disable this option (FALSE), is not implemented. This option flag will be defunct in a future version

print

DEPRECATED, please use print_plot.

print_plot

Flag to enable plot graphic device to print to PNG or PNG files.

png

DEPRECATED. Please use use_png.

use_png

Enables plots to be generated to PNG files. Defaults to print value

pdf

DEPRECATED. Please use use_pdf.

use_pdf

Enables plots to be generated to pdf file.

indexselect

Vector of fleet numbers for each model for which to compare

miny

minimum abs values of ylim

col

Optional vector of colors to be used for lines. Input NULL

pch

Optional vector of plot character values

lty

Optional vector of line types

lwd

Optional vector of line widths

tickEndYr

Logical flag: set TRUE or FALSE to switch to turn on/off extra axis mark at final year in timeseries plots.

xlim

Optional, years to use for x-axis. Default value NULL (or "default"), uses all years available.

ylim

Optional, min and max values for the ylim to override the "default" value (-0.7, 0.5)

ylimAdj

Multiplier for ylim parameter. Allows additional white space.

xaxs

Choice of xaxs parameter See ?par for more info.

yaxs

Choice of yaxs parameter. See ?par for more info.

xylabs

Logical flag. Enables x- and y-axis labels.

type

The type of plot to be drawn. For more details, see plot.

legend

Flag to enable legend to plot. TRUE by default.

legendlabels

Optional vector of labels to include in legend.

legendloc

Location of legend. Either a string like "topleft" or a vector of two numeric values representing the fraction of the maximum in the x and y dimensions, respectively. See help("legend") for more info on the string options.

legendorder

Optional vector of model numbers that can be used to have the legend display the model names in an order that is different than that which is represented in the summary input object.

legendncol

Number of columns for the legend.

legendcex

Allows to adjust legend cex

legendsp

Space between legend labels

legendindex

Allows to add legend for selected indices (plots)

pwidth

Default width of plot printed to plot in units of punits

pheight

Height of plot printed to plot in units of punits

punits

Measurement units for pwidth and pheight. Default is "in".

  • "px" (pixels)

  • "in" (inches)

  • "cm" (centimeters)

  • "mm" (millimeters)

res

Resolution for plots printed to files.

ptsize

Point size for plotted text in plots printed in files. See help("png") for more details

cex.main

Character expansion for plot titles.

plotdir

Directory where output plot file will be written. By default, it will be the directory where the model was run.

filenameprefix

Additional text to append to output plot file name. It will be separated from default name by an underscore.

par

A numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot,which is passed to par(). Entering NULL passes plot's default par() values (which depends on whether the main title is included or not)

verbose

Flag to print additional diagnostic messages to R console

boxcol

color boxes

new

Deprecated. New plot windows are created by default (TRUE), and the option to disable this, via FALSE, is unused.

add

suppresses par() to create multiplot figs

Author

Henning Winker (JRC-EC)