dat <- c(a = "2020-01-02")
# names kept
as.Date(dat)
#> a
#> "2020-01-02"
# names dropped
grates::as_yearweek(dat)
#> <grates_yearweek_monday[1]>
#> [1] "2020-W01"
# this should be TRUE
all.equal(
as.Date(grates::as_yearweek(dat, 4)),
as.Date(dat)
)
#> [1] "names for current but not for target"
Created on 2025-08-15 with reprex v2.1.1
Created on 2025-08-15 with reprex v2.1.1