I am trying to convert a vector of factors into a vector of dates. The data is formatted as month/date (e.g. 5/20, 4/13, 11/11). I want to retain the format but need to change the data type from factor to date.
df$date <- as.Date(df$date, format = '%m/%d')
Is what I have at the moment. What is returned is 2017-5-20 or 2017-4-13 for example. My question is, is there a way to have as.Date not return the year? Additionally, is there a way to do this in lubridate that may be more efficient? I would like my output to return 5-20 or 4-13. All examples I find online always include the year and seem to leave my question unanswered.