I have some dates (character string) with only month and date, for example "20-May". I'm using as.Date to convert it to a date object:
as.Date("20-May", format = "%d-%b")
What I got is: "2021-05-20"
. So R automatically sets the year to the current year. But I want to customize the year to 2019 (expect the output to be "2019-05-20"
). How to do that?