hydroYear: Returns a vector of the hydrological year for the input data...

View source: R/hydroYear.R

hydroYearR Documentation

Returns a vector of the hydrological year for the input data frame

Description

Calculates the hydrological year, based on the starting month.

Usage

hydroYear(CRHMdata, startMonth = 10, useSecondYear = TRUE, logfile = "")

Arguments

CRHMdata

Required. A CRHMr data frame.

startMonth

Optional. The starting month for the hydrological year. Default is 10 (October).

useSecondYear

Optional. Logical. Determines if the hydrological year is based on the first or second calendar year. In other words would the hydrological year for January 1, 2015 be 2014 or 2015? The default is TRUE (i.e., the hydrological year would be 2015). Note that the Campbell Scientific program SPLIT uses the first calendar year (i.e., the hydrological year would be 2014). To emulate this program, set useSecondYear to be FALSE.

logfile

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

Value

If successful, returns the hydrological year as a vector. If unsuccessful, returns an error.

Author(s)

Kevin Shook. Inspired by a function by Chris Marsh.

See Also

aggDataframe

Examples

# create a new data frame, then add the hydro year
BadLake <- BadLake7376
BadLake$hydroyear <- hydroYear(BadLake, startMonth = 9)

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