Hi,
I have Year as a character type variable. I am trying to change it as Date type, however, I don't want to include false months and days in order to do that. Is there any way to have just Year but also as Date type. Currently, I can only get it while including false month and day with the following code
df <- df%>%
mutate(Year = ymd(Year, truncated = 2L))
This produces the pattern 2015-01-01 for all different years with same month and day.
Thanks for your help!