plotMDFR.Fits.TimeSeries: Plot comparisons of fits to time series from a set of model...

View source: R/plotMDFR.Fits.TimeSeries.R

plotMDFR.Fits.TimeSeriesR Documentation

Plot comparisons of fits to time series from a set of model runs, with a "zoom" for recent years

Description

Function to plot a comparison of fits to time series from a set of model runs, with a "zoom" for recent years.

Usage

plotMDFR.Fits.TimeSeries(
  dfr,
  plot1stObs = TRUE,
  numRecent = 15,
  x = "y",
  y = "val",
  lci = "lci",
  uci = "uci",
  case = "case",
  type = "type",
  facets = NULL,
  scales = "fixed",
  position = ggplot2::position_dodge(0.2),
  plotObs = TRUE,
  plotMod = TRUE,
  xlab = "year",
  ylab = NULL,
  title = NULL,
  xlims = NULL,
  ylims = NULL,
  colour_scale = ggplot2::scale_colour_hue(),
  fill_scale = ggplot2::scale_fill_hue(),
  showPlot = FALSE,
  verbose = FALSE
)

Arguments

dfr
  • dataframe

plot1stObs
  • flag to plot observations from first case only

numRecent
  • number of "recent" years to plot

x
  • column name with x axis values

y
  • column name with y axis values

lci
  • column name with y axis values

uci
  • column name with y axis values

case
  • column name with case names

type
  • column name with type values (i.e., "observed","predicted")

facets
  • grid faceting formula (as an expresssion for multilevel faceting)

scales
  • ggplot2 scales option for facet_grid

position
  • indicates ggplot2 position_ to use ('dodge','jitter','identity',)

plotObs
  • plot observations

plotMod
  • plot model fits/predictions

xlab
ylab
title
xlims
ylims
colour_scale
  • ggplot2 scale_colour object (default is ggplot2::scale_colour_hue())

fill_scale
  • ggplot2 scale_fill object (default is ggplot2::scale_fill_hue())

showPlot
  • flag (T/F) to print plot

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

Details

Uses plotMDFR.Fits.TimeSeries1() to make the plots. numRecent provides the "zoom" for a second set of faceted plots including only the most recent years. If numRecent is 0, this plot is not created and an NA is substituted.

Note that facets should be given as an expression, not as a character string, if you want multilevel faceting.

Value

list with requested ggplot objects


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