Create a list that contains all the necessary formats of the time of interest.
Usage
get_toi(date)
date_seq(from, to, by = "day")
doy_to_date(doy, year)
pdoy_to_date(pdoy)
Arguments
- date
character. A vector of dates.
- from
character. First date.
- to
character. Last date.
- by
character. Increment of sequence, e.g. day
- doy
numeric. A vector of days-of-year.
- year
numeric. A vector of years.
- pdoy
character. A vector of three-digit day-of-year (padded with zeros).
Value
get_toi() returns a list with elements date, year, uyear, month, doy, pdoy, and name.
date_seq(), doy_to_date(), pdoy_to_date() return a sequence of Dates.
Examples
if (FALSE) {
dates <- date_seq("2002-01-01", "2002-01-04")
toi <- get_toi(dates)
doy_to_date(c(1, 365), c(2002, 2005))
pdoy_to_date(c("2002001", "2005365"))
}