compareDiffs: Function to compare differences of a quantity among several...

View source: R/compareDiffs.R

compareDiffsR Documentation

Function to compare differences of a quantity among several models

Description

This function compares differences of a quantity among several models.

Usage

compareDiffs(
  dfr,
  base = 1,
  diff.type = c("percent", "absolute"),
  diff.min = 0.001,
  cast = NULL,
  facet_grid = NULL,
  facet_wrap = NULL,
  nrow = NULL,
  ncol = NULL,
  scales = "fixed",
  dodge = 0.2,
  title = "",
  years = "all",
  showPlot = FALSE,
  pdf = NULL,
  verbose = FALSE
)

Arguments

dfr
  • dataframe in canonical format

diff.type
  • "percent" or "absolute"

diff.min
  • minimum difference to show

cast
  • cast'ing formula for aggregating by factors before differencing (default is:fleet+x+m+s+z+y)

facet_grid
  • formula (or string version of formula) for faceting using facet_grid

facet_wrap
  • one-sided formula (e.g., "~y+x") or character vector (e.g., c('y','x')) for faceting using facet_wrap

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

ncol
  • number of columns per page, when facet_wrap'ing

scales
  • scales parameter for use with facet_grid/facet_wrap

dodge
  • width to dodge overlapping series

years
  • 'all' or vector of years to include

showPlot
  • flag (T/F) to show plot

pdf
  • creates pdf, if not NULL

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

Details

The aggregating function fun aggregates values over the dataframe factors not included in the casting formula. If 'z' and 'y' are cast'ing factors, then a set of annual size composition plots are produced. If 'z' is a cast'ing factor but not 'y', 'z' will be used as the x axis. Otherwise, a set of time series plots are produced.

Uses compteDiff() to calculate the differences among model cases.

Value

list of ggplot2 objects


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