I need to convert a string of dates that is in multiple formats to valid dates.
e.g.
dates <- c(\"01-01-2017\",\"02-01-2017\",\"12-01-2016\",\"20
I have tried library(anytime), however for big data did not work. Then, I found useful this sequence:
df$Date2 <- format(as.Date(df$Date, format="%m/%d/%Y"), "%d/%m/%y") df$Date2 <- as.Date(df$Date2,"%d/%m/%y")
It worked for me to "8/10/2005" as well as "08/13/05" in the same column.