Covert R dataframe column to Date
The parse_date_time function from the lubridate package will do this. This function takes an argument orders which is like the tryFormats argument in 'as.Date', except the formats allowed are more generous and lubridate-like (without punctuation, delimiters, etc.). For example, you can set orders = c(&quot;dmy&quot;, &quot;mdy&quot;).
Date &lt;- c('22-04-2015', '4/8/2015')
parse_date_time(Date, orders = c(&quot;dmy&quot;, &quot;mdy&quot;))
&quot;2015-04-22 UTC&quot; &quot;2015-08-04 UTC&quot;