season_fct: Returns a season factor

View source: R/season_fct.R

season_fctR Documentation

Returns a season factor

Description

Creates a factor with the four seasons DJF, SON, MAM, JJA (so to keep the annual order), with the option to define the first season (factor level), from a vector of numeric/integer months.

Usage

season_fct(month, first_season = "DJF")

Arguments

month

numeric month

first_season

character season, which should be the first level (default: "JJA")

Value

Factor vector of the same length as input.

Examples


month <- sample(1:12, 30, replace = TRUE)
month
season_fct(month)
str(season_fct(month))

season_fct(month, first_season = "JJA")
str(season_fct(month, first_season = "JJA"))

mitmat/mitmatmisc documentation built on Aug. 22, 2024, 3:28 a.m.