season function

Assign seasons to months

Assign seasons to months

season(x, lang = c("en", "es")) seasonally(x) is.full_season(x)

Arguments

  • x: A vector of dates (alternative a numeric vector of months, for season())
  • lang: Language to use.

Returns

season() returns a factor vector of the same length as x with the trimester of each month. seasonaly() returns a date vector of the same length as x with the date "rounded" up to the centre month of each season. is.full_season() returns a logical vector of the same length as x that is true only if the 3 months of each season for each year (December counts for the following year) are present in the dataset.

Examples

season(1, lang = "en") season(as.Date("2017-01-01")) seasonally(as.Date(c("2017-12-01", "2018-01-01", "2018-02-01"))) is.full_season(as.Date(c("2017-12-01", "2018-01-01", "2018-02-01", "2018-03-01")))
  • Maintainer: Elio Campitelli
  • License: GPL-3
  • Last published: 2025-02-24