Maps an ISO week number to its position within the surveillance season, where season week 1 corresponds to ISO week 35.
Usage
isoweek_to_seasonweek_n(x)
# Default S3 method
isoweek_to_seasonweek_n(x)
# S3 method for class 'character'
isoweek_to_seasonweek_n(x)
# S3 method for class 'numeric'
isoweek_to_seasonweek_n(x)Details
Surveillance seasons start at ISO week 35, so ISO week 35 is season week 1. ISO week 36 is season week 2, and the numbering continues across the new year. ISO week 53 occurs only in long ISO years. It maps to the half-step season week 18.5, so that the surrounding weeks keep consistent numbering.
See also
seasonweek_to_isoweek_n() and seasonweek_to_isoweek_c() convert
back. They return different classes from each other, so they are not a
family.
vignette("cstime", package = "cstime") and
vignette("season", package = "cstime"), which both run this function.
Examples
isoweek_to_seasonweek_n(35)
#> [1] 1
isoweek_to_seasonweek_n(c(31, 53))
#> [1] 49.0 18.5
