
Date to ISO yearweek (character)
Source:R/conversion_date_isoweek_isoyear.R
date_to_isoyearweek_c.RdConverts a date to a combined ISO 8601 year and week string of the form "yyyy-ww".
Details
The output combines the ISO year (see date_to_isoyear_c()) and the
zero-padded ISO week (see date_to_isoweek_c()), separated by a hyphen, for
example "2021-32". Because the ISO year can differ from the calendar year,
2021-01-01 maps to "2020-53".
See also
vignette("date_conversion", package = "cstime"), which runs this
function.
Other date-to-character converters:
date_to_calmonth_c(),
date_to_calyear_c(),
date_to_calyearmonth_c(),
date_to_isoquarter_c(),
date_to_isoweek_c(),
date_to_isoyear_c(),
date_to_isoyearquarter_c()
Examples
date_to_isoyearweek_c(as.Date("2021-08-11"))
#> [1] "2021-32"
date_to_isoyearweek_c("2021-01-01")
#> [1] "2020-53"