I've imported a dataset with dates in the format 'month year' (e.g. July 2020
), which have automatically been parsed as characters. I'm trying to convert them to dates, using lubridate::parse_date_time()
. When I do this, lubridate returns a list of dates (e.g. "2020-07-01 UTC", "2020-07-01 UTC", "2020-07-01 UTC", "2020-07-01 UTC", "2020-07-01 UTC", "2020-06-01 UTC", "2020-06-01 UTC", "2020-06-01 UTC", "2020-06-01 UTC", "2020-06-01 UTC"
etc).
This is what I want, but now I'm stuck: I'm not sure how to get these back into my original dataframe, replacing the previous column of characters with this new date representation. Is there a really obvious way to do this?