water_year: Get water year component of datetime(s)

Description Usage Arguments Value Examples

Description

A water year is a 12-month period beginning in some month other than January. The water year is designated by the calendar year in which it ends (e.g. water year 2007 ends on 2007-09-30 if the starting month is October)

Usage

1
water_year(x, start_month = 10)

Arguments

x

vector of datetime objects

start_month

integer specifying first month of water year (default = 10 for October)

Value

vector of water years as decimal numbers

Examples

1
2
x <- seq.Date(from = as.Date("2007-09-30"), to = as.Date("2007-10-02"), by = "day"))
water_year(x)

walkerjeffd/walkerenvres documentation built on May 3, 2019, 10:46 p.m.