monthlyPrecipTotals: Returns mean monthly precipitation totals

View source: R/monthlyPrecipTotals.R

monthlyPrecipTotalsR Documentation

Returns mean monthly precipitation totals

Description

Calculates mean total precipitation for each calendar month in the observation data frame. Optionally plots the values. Can work with p and/or ppt values.

Usage

monthlyPrecipTotals(obs, precipCols = 0, plot = TRUE, logfile = "")

Arguments

obs

Required. A CRHMr data frame containing p and/or ppt values.

precipCols

Optional. A vector containing the columns to be analyzed, not including the datetime column. If not specified, all precipitation columns are used.

plot

Optional. If TRUE, which is the default, a ggplot2 object of the monthly mean precipitations is returned. If FALSE, the values are returned as a data frame.

logfile

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

Value

If successful, returns either a data frame or a ggplot2 object of the monthly mean precipitations. If unsuccessful, returns FALSE.

Author(s)

Kevin Shook

See Also

aggDataframe monthlyQQplot

Examples

## Not run: 
marmot_monthly_plot <- monthlyPrecipTotals(marmot)
marmot_monthly_means <- monthlyPrecipTotals(marmot, plot = FALSE)

## End(Not run)

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