Learn R Programming

winfapReader (version 0.1-7)

water_year: Derive water year value for a date

Description

Derive water year value for a date

Usage

water_year(date, start_month = 10, start_hour = 9, tz = "UTC")

Value

The water year value

Arguments

date

the (vector of) dates for which the water year will be calculated

start_month

the month in which the water year starts, default is October

start_hour

the time of the day in which the water year starts, default is 9

tz

time zone for the record, defaults to "UTC"

Examples

Run this code
if (FALSE) {
water_year(c(as.POSIXct("1958-10-01 09:00:00", tz = "UTC"),
             as.POSIXct("2021-10-01 12:00:00", tz = "UTC"),
             as.POSIXct("1918-10-01 08:55:00", tz = "UTC")))

water_year(c(as.Date("2021-01-01"),as.Date("2021-11-01"),
as.Date("2019-02-01"),as.Date("1965-09-30")))
}

Run the code above in your browser using DataLab