climateYear: Climate Year

View source: R/climateYear.R

climateYearR Documentation

Climate Year

Description

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

Usage

climateYear(x, numeric = FALSE)

Arguments

x

an object of class "Date" or "POSIXt." Missing values are permitted and reesult 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 climate year.

Note

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

See Also

year, waterYear

Examples


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

USGS-R/DVstats documentation built on Oct. 11, 2022, 6:03 a.m.