doubleMass: Calculates double mass values

View source: R/doubleMass.R

doubleMassR Documentation

Calculates double mass values

Description

Calculates cumulative sums for two variables and optionally returns a plot. Only values coinciding in time are used for the cumulative sums.

Usage

doubleMass(
  primaryObs,
  primaryCol = 1,
  secondaryObs,
  secondaryCol = 1,
  plot = TRUE,
  logfile = ""
)

Arguments

primaryObs

Required. The primary CRHMr data frame of obs values.

primaryCol

Optional. The column number to be used, not including the datetime. If not specified, defaults to the first column.

secondaryObs

Required. The secondary CRHMr data frame of obs values.

secondaryCol

Optional. The column number to be used, not including the datetime. If not specified, defaults to the first column.

plot

Optional. Should a plot be created? Default is FALSE.

logfile

Optional. Name of the file to be used for logging the action. Normally not used.

Value

If plot = TRUE, then a ggplot2 object will be returned, with the primaryObs values plotted on the x-axis and the secondaryObs values plotted on the y-axis. Otherwise, a dataframe is returned with the cumulative values of each of the variables.

Author(s)

Kevin Shook

Examples

## Not run: 
p <- doubleMass(primaryObs=CamrosePPT, secondaryObs=WetaskiwinPPT, plot=TRUE)
## End(Not run)

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