plot_DO_preds: Plot predictions produced with predict_DO

View source: R/plot_DO_preds.R

plot_DO_predsR Documentation

Plot predictions produced with predict_DO

Description

Plots modeled values as lines, observed values as points

Usage

plot_DO_preds(
  DO_preds,
  y_var = c("conc", "pctsat", "ddodt"),
  style = c("ggplot2", "dygraphs"),
  y_lim = list(conc = c(NA, NA), pctsat = c(NA, NA), ddodt = c(NA, NA)),
  date_start = NA,
  date_end = NA,
  use_saved = TRUE
)

Arguments

DO_preds

a data.frame of predictions such as that returned by predict_DO()

y_var

character. Should the plot display predicted & observed values in concentration (conc) or as percent of saturation (pctsat)? The default is to plot both.

style

character indicating which graphics package to use

y_lim

list of named vectors, each of which has length 2 and is numeric and has a name in the possible values of y_var. NA within a vector indicates that the data range should be used. for ggplot2, y_lim is only used to exclude values outside that range and is ignored if the data span a narrower range

date_start

Date or a class convertible with as.Date. The first date (inclusive) for which to report DO predictions. If NA, no filtering is done.

date_end

Date or a class convertible with as.Date. The last date (inclusive) for which to report DO predictions. If NA, no filtering is done.

use_saved

logical. Is it OK to use predictions that were saved with the model?

Examples

## Not run: 
mm <- metab_night(specs(mm_name('night')), data=data_metab('3', day_start=12, day_end=36))
plot_DO_preds(mm)
plot_DO_preds(mm, date_start='2012-09-19', date_end='2012-09-19')
plot_DO_preds(mm, style='dygraphs', y_var='pctsat')

## End(Not run)

USGS-R/streamMetabolizer documentation built on Aug. 15, 2023, 7:50 a.m.