R/wtr_yr.R

Defines functions wtr_yr

wtr_yr <- function(dates, start_month=9) {
  # Convert dates into POSIXlt
  dates.posix = as.POSIXlt(dates)
  # Year offset
  offset = ifelse(dates.posix$mon >= start_month - 1, 1, 0)
  # Water year
  adj.year = dates.posix$year + 1900 + offset
  # Return the water year
  adj.year
}
kcstreamteam1/wlRd-package documentation built on Aug. 4, 2017, 6:34 a.m.