cumulativeDischargePlot: Plots cumulative CRHM and/or WSC flows

View source: R/cumulativeDischargePlot.R

cumulativeDischargePlotR Documentation

Plots cumulative CRHM and/or WSC flows

Description

Creates a ggplot object of annual cumulative flows from a data frame of CRHM output and/or WSC daily flows. The WSC flows are obtained from the tidyhydat package. The WSC data is truncated so that it only includes the range of the CRHM data. If more than a single year of data is specified, then the plot will be faceted by year.

Usage

cumulativeDischargePlot(
  CRHMflows = NULL,
  CRHMflowsLabel = "",
  CRHMflowCol = 1,
  WSCdailyFlowsID = NULL,
  WSCdailyFlowsLabel = "",
  facetCols = 3,
  quiet = TRUE,
  hydat_path = NULL
)

Arguments

CRHMflows

Optional. Optional. A data frame of CRHM modelled flows. The flows must be in m^3/s.

CRHMflowsLabel

Optional. Labels for the CRHM data. If not specified, and CRHM data are plotted, then the name of the CRHM variable will be used.

CRHMflowCol

Optional. Column containing the flowrates, not including the datetime. Default is 1.

WSCdailyFlowsID

Optional. If NULL (the default) the WSC daily flows will not be plotted. If a WSC station ID is specified , e.g. WSCdailyFlowsID = "05CC001", then the daily flows will be obtained from tidyhydat and plotted.

WSCdailyFlowsLabel

Optional. Labels for the daily flows. If not specified, then the WSC station number will be used, followed by daily.

facetCols

Optional. Number of columns to wrap the facets (if they are used). Setting a value less than 1 will cause an error.

quiet

Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave quiet=TRUE (i.e. the default). If you are working interactively, you will probably want to set quiet=FALSE.

hydat_path

Optional. Path to the HYDAT database. This can usually be left blank.

Value

If successful, returns a ggplot2 object containing the cumulative discharge plot. If unsuccessful, the value FALSE will be returned.

Author(s)

Kevin Shook

See Also

hydrograph

Examples

## Not run: 
p <- cumulativeDischargePlot(CRHMflows = crhm_output, WSCdailyFlowsID = "05FA025",
 facetCols=2, quiet=FALSE)
## End(Not run)

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