season: Assign seasons to months

View source: R/season.R

seasonR Documentation

Assign seasons to months

Description

Assign seasons to months

Usage

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.

Value

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")))


eliocamp/metR documentation built on Feb. 15, 2024, 1:23 p.m.