waterYear: Water Year

View source: R/waterYear.R

waterYearR Documentation

Water Year

Description

Create an ordered factor or numeric values from a vector of dates based on the water year.

Usage

waterYear(x, numeric = FALSE)

Arguments

x

an object of class "Date" or "POSIXt." Missing values are permitted and result in corresponding missing values in the output.

numeric

a logical value that indicates whether the returned values should be numeric TRUE or an ordered factor FALSE. The default value is FALSE.

Value

An ordered factor or numeric vector corresponding to the water year.

Note

The water year is defined as the period from October 1 to September 30. The water year is designated by the calendar year in which it ends. Thus, the year ending September 30, 1999, is the "1999 water year."

See Also

year

Examples


library(smwrData)
data(QW05078470)
## Return an ordered factor
waterYear(QW05078470$DATES)

USGS-R/smwrBase documentation built on Oct. 18, 2022, 9:55 a.m.