Skip to contents

Maps an ISO yearweek to the surveillance season it belongs to, written as "yyyy/yyyy".

Usage

isoyearweek_to_season_c(x)

# Default S3 method
isoyearweek_to_season_c(x)

# S3 method for class 'character'
isoyearweek_to_season_c(x)

Arguments

x

ISO yearweek as a character string of the form "yyyy-ww", e.g. "2021-01".

Value

Season as a character vector (e.g. "2020/2021").

Details

Seasons start at ISO week 35 (season week 1). ISO weeks 35 and later belong to the season that starts in that calendar year. Earlier weeks belong to the season that started in the previous calendar year. For example, "2021-01" falls in season "2020/2021" and "2021-50" falls in season "2021/2022".

See also

isoyearweek_to_seasonweek_n() for the week within that season, and season_to_last_date() for the date the season ends. vignette("season", package = "cstime") for worked season week conversions. No vignette runs this function.

Examples

isoyearweek_to_season_c(c("2021-01", "2021-50"))
#> [1] "2020/2021" "2021/2022"