Hello there,
I have some year-week or week-year formats for the date index. For example: "52/2022" or: "52-2022" ; "2022/52" or "2022-52". I have done several functions for converting them to date objects. All the attempts goes in vain. Such as:
> x = "2012 25"
> parse_date_time(x, "y W")
[1] "2012-10-28 UTC"
> parse_date_time(x, "Y W")
[1] "2012-10-28 UTC"
> week = as.Date(x="2020/25",format = "%Y/%U")
> week
[1] "2020-10-28"
How can I convert these types of date formats into date objects?