I have data in a specifc format year_isoweek, e.g., 2019_31 for this week. And I want this represented as a date for further processing.
basic r
and lubridate
;
I found some work arounds that have merit, but none of these work with ISO 8601 (%V) which leads to other problems in turn:
convert year week string to date
Convert week number to date
Transform year/week to date object
a <- c("2019_7", "2019_3", "2018_18")
as.Date(a, "%Y_%V")
Actual output:
[1] "2019-07-31" "2019-07-31" "2018-07-31"
What I want:
"2019-02-11" "2019-01-14" "2018-04-30"
as class date