
ISO year to last ISO yearweek (character)
Source:R/conversion_date_isoweek_isoyear.R
isoyear_to_last_isoyearweek_c.RdReturns the last ISO yearweek of a given ISO year as a "yyyy-ww" string.
Usage
isoyear_to_last_isoyearweek_c(x)
# Default S3 method
isoyear_to_last_isoyearweek_c(x)
# S3 method for class 'character'
isoyear_to_last_isoyearweek_c(x)
# S3 method for class 'numeric'
isoyear_to_last_isoyearweek_c(x)Details
Most ISO years have 52 weeks, so the result is usually "yyyy-52". ISO years that contain 53 weeks (such as 2020) instead return "yyyy-53". The year is accepted as either a number or a character string.
See also
isoyear_to_last_isoweek_n() and isoyear_to_last_date() answer
the same question as a week number and as a date.
vignette("date_conversion", package = "cstime") for worked date, ISO year
and ISO week conversions. No vignette runs this function.
Examples
isoyear_to_last_isoyearweek_c(c(2019, 2020, 2021))
#> [1] "2019-52" "2020-53" "2021-52"
isoyear_to_last_isoyearweek_c("2020")
#> [1] "2020-53"