View source: R/add_hydro_year.R
add_hydro_year | R Documentation |
Adds a hydrological year starting at a specific month (default = 10). The hydrological year is identified by the ending month, e.g. 2002-10 to 2002-12 and 2003-01 to 2003-09 will have the same hydro_year=2003.
add_hydro_year(ref_dat, start_month = 10)
ref_dat |
a |
start_month |
numeric, which should be the first month of the hydro_year |
Requires that input data has column(s) "date" or c("year", "month").
Nothing, adds column by reference.
dat <- data.table::data.table(
date = lubridate::ymd(c("2002-08-15", "2002-09-30", "2002-10-01", "2002-12-31",
"2003-01-01", "2003-08-15", "2003-09-30", "2003-10-01"))
)
dat
add_hydro_year(dat)
dat
add_hydro_year(dat, start_month = 9)
dat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.