I have a dataframe where I extracted the week and year number using lubridate
. I do not have the date values anymore.
I want to extract the month from the week number and year number.
df
Week Year
1 2018
5 2018
45 2017
I want my final output to be this:
Week Year Month
1 2018 1
5 2018 2
45 2017 11
This extracts the month of the first day of the week, you could add a constant or something if you wanted the 2nd or 3rd day of the week instead.