Returns an ordered factor of the user specified seasons.
dtt_season(x, seasons = c(Spring = 3L, Summer = 6L, Autumn = 9L, Winter = 12L))
x | A Date or POSIXct vector |
---|---|
seasons | A uniquely named integer vector of the first month of each season or a uniquely named Date vector of the first dayte of each season. |
An ordered factor of the seasons.
If the first month of the first season isn't January (1L), then the last season is considered to wrap into the following year.
#> [1] Winter Winter Autumn Winter #> Levels: Winter < Spring < Summer < Autumn#> [1] Dry Period Monsoon Dry Period Dry Period #> Levels: Dry Period < Monsoon#> [1] First First Second Second #> Levels: First < Second