compareResults.Pop.CohortProgression: Function to compare cohort progression by year among several...

View source: R/compareResults.Pop.CohortProgression.R

compareResults.Pop.CohortProgressionR Documentation

Function to compare cohort progression by year among several models

Description

This function compares cohort progression by year among several models.

Usage

compareResults.Pop.CohortProgression(
  objs,
  cast = "x+m+s+z",
  scaleToDensity = FALSE,
  aggToCutpts = FALSE,
  cutpts = seq(25, 185, 5),
  facet_grid = NULL,
  facet_wrap = NULL,
  dodge = 0.2,
  years = NULL,
  mxy = 4,
  nrow = 2,
  lnscale = FALSE,
  scales = "fixed",
  types = c("progression", "byyear"),
  plotPoints = FALSE,
  shapes = "s",
  plotLines = TRUE,
  linetypes = "ms",
  showPlot = FALSE,
  pdf = NULL,
  verbose = FALSE
)

Arguments

objs
  • list of TCSAM02 resLst objects (or a dataframe from extractMDFR.Pop.CohortProgression())

cast
  • casting formula for excluding x,m,s,z factor levels from sums across the unspecified factors

scaleToDensity
  • flag to scale abundance to 1-mm size bins

aggToCutpts
  • flag to aggregate (rebin) to provided cutpts

cutpts
  • cutpoints to aggregate to

facet_grid
  • formula for faceting using facet_grid

facet_wrap
  • formula for faceting using facet_wrap

dodge
  • width to dodge overlapping series

years
  • numeric vector of years to include (or NULL for all)

mxy
  • max number of years per page

nrow
  • number of rows per page, when facet_wrap'ing

lnscale
  • use log scale on y axis

scales
  • scales parameter for facet_grid/facet_wrap

types
  • types of plots to produce ("progression","byyear")

plotPoints
  • flag to plot points

shapes
  • name of column for ggplot shape factors (defaults to 's' for shell condition)

plotLines
  • flag to plot cohorts as lines

linetypes
  • name of column for ggplot linetype factors (defaults to 'ms' for maturity + shell condition)

showPlot
  • flag (T/F) to show plot

pdf
  • filename for pdf output (or NULL for no pdf)

verbose
  • flag (T/F) to print diagnostic information

Details

If objs is a list of TCSAM02 resLst objects, model results are extracted using extractMDFR.Pop.CohortProgression(). objs can also be a dataframe output extractMDFR.Pop.CohortProgression(). Plots are made using plotMDFR.XY(). You can an plot cohort abundance as a progression by stage for each model (types="progression" or as size distributions by year with colours indicating different models (types="byyear". Sex-specific cohort progressions are plotted separately. By default, different maturity/shell condition categories are indicated using different linetypes.

Value

a list of ggplot2 objects, with potential captions as element names.


wStockhausen/rCompTCMs documentation built on Sept. 12, 2023, 3:13 p.m.