simpleRibbonPlot: Simple plots of CRHM output max, min and mean values

View source: R/simpleRibbonPlot.R

simpleRibbonPlotR Documentation

Simple plots of CRHM output max, min and mean values

Description

Creates ggplot2 ribbon plots of the daily minimum, maximum and mean values for all selected variables over a year, for models without sub-basins. The shaded area indicates the range of values in the data frame for each day.

Usage

simpleRibbonPlot(
  CRHMoutput,
  columns = "all",
  waterYear = FALSE,
  ylabel = "Basin total (mm)",
  skipLeapDay = TRUE,
  facet = FALSE,
  facetColour = "blue",
  facetCols = 3
)

Arguments

CRHMoutput

Required. A data frame containing either instantaneous or cumulative values. The data may be either daily or hourly.

columns

The columns to be aggregated, not including the datetime. The default is the all, but can be a vector, i.e. c(1,2,3). Note that all variables must have the same units.

waterYear

Optional. If True, the statistics are calculated and plotted by water year, if FALSE (the default) the statistics are calculated and plotted by calendar year. If you are plotting cumulative values using cumulDailyWater, this parameter must be set to be the same as that function.

ylabel

Optional. Label to be used for the y-axis.

skipLeapDay

Optional. If TRUE (the default) then values for Feb. 29 will be omitted from the analyses and plots. If FALSE, then these values will be included, which may result in strange-looking plots.

facet

Optional. If FALSE (the default), then all variables will be on a single plot. If TRUE, then each variable will be on a separate facet.

facetColour

Optional. The colour to be used for shading the ribbon plot in each facet, if selected.

facetCols

Optional. The number of columns to be used for the facets, if selected.

Value

If unsuccessful, returns FALSE. If successful, returns a ggplot2 object.

Author(s)

Kevin Shook

See Also

cumulDailyWater

Examples

## Not run: 
p <- ribbonPlot(waterYearCumul, waterYear=TRUE, units='mm', facet=TRUE, facetCols=2
## End(Not run)

CentreForHydrology/CRHMr documentation built on April 6, 2024, 5:27 p.m.