I currently have a data source where the format in the column date is (DD-MM-YYYY) for my analysis the script is not processing the date correctly because it needs to be in the format of (YYYY-MM-DD). When I look at my current date here is the output. These dates are currently being used in a plot
> str(provinces$date)
Factor w/ 73 levels "01-03-2020","01-04-2020",..: 72 72 72 19 19 19 35 35 35 46 ...
I took a look at some other solutions and saw that one method to do this was with.
dateNew <- as.Date(date, format = "%d %b %y")
However, when I process this, I am presented with the error
Date[1:912], format: NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA ...
Any tips on how to reformat the date column?