powered by
Compute "water" day and year, based on the end of the typical or legal dry season. This is September 30 in California.
waterDayYear(d, end = "09-30", format = "%Y-%m-%d", tz = "")
anything the can be safely converted to POSIXlt
POSIXlt
"MM-DD" notation for end of water year
Used in POSIXlt conversion. Default "%Y-%m-%d"
"%Y-%m-%d"
Used in POSIXlt conversion for custom timezone. Default "" is current locale
""
A data.frame object with the following
data.frame
the "water year"
the "water day"
This function doesn't know about leap-years. Probably worth checking.
Ideas borrowed from: https://github.com/USGS-R/dataRetrieval/issues/246 and https://stackoverflow.com/questions/48123049/create-day-index-based-on-water-year
# NOT RUN { # try it waterDayYear('2019-01-01') # }
Run the code above in your browser using DataLab