
ISO year to last ISO week (numeric)
Source:R/conversion_date_isoweek_isoyear.R
isoyear_to_last_isoweek_n.RdReturns the number of the last ISO week in a given ISO year, that is, the count of ISO weeks in that year.
Usage
isoyear_to_last_isoweek_n(x)
# Default S3 method
isoyear_to_last_isoweek_n(x)
# S3 method for class 'character'
isoyear_to_last_isoweek_n(x)
# S3 method for class 'numeric'
isoyear_to_last_isoweek_n(x)Details
This is 52 for most years and 53 for long ISO years such as 2020. The year is accepted as either a number or a character string.
See also
isoyear_to_last_isoyearweek_c() and isoyear_to_last_date()
answer the same question as a yearweek string 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_isoweek_n(c(2019, 2020, 2021))
#> [1] 52 53 52
isoyear_to_last_isoweek_n("2020")
#> [1] 53