Converts a date to its ISO 8601 week-based year, returned as a number.
Details
The ISO 8601 week-based year can differ from the calendar year near the
start and end of January and December. See date_to_isoyear_c() for the
rules used to assign weeks and years.
See also
vignette("date_conversion", package = "cstime"), which runs this
function.
Other date-to-number converters:
date_to_calmonth_n(),
date_to_calyear_n(),
date_to_isoquarter_n(),
date_to_isoweek_n()
Examples
date_to_isoyear_n(as.Date("2021-08-11"))
#> [1] 2021
date_to_isoyear_n("2021-01-01")
#> [1] 2020
