Determines Water Year from a date field

WY(date, WY.type = "FL")

Arguments

date

Date in as.POSIXct or as.Date format

WY.type

Specifies Federal ("Fed") or Florida ("FL") water years

Value

Returns water year value based on Federal (Starts Oct 1) or Florida (Starts May 1),

Examples

dates=as.Date(c("2015-05-01","2015-08-20","2015-12-15"))
WY(dates)
#> [1] 2016 2016 2016