I'm trying to convert a character column with dates to date format. However, the dates are in an ambiguous format. Some entries are of the format %d.%m.%Y
(e.g., "03.02.2021"), while others are %d %b %Y
(e.g., "3 Feb 2021").
I've tried as.Date(tryFormats=c("%d %b %Y", "%d.%m.%Y"))
, but realized that tryFormats
is only flexible for the first entry, so that the entries of type %d %b %Y
are correctly identified but those of %d.%m.%Y
become NA
s, or vice versa. I've also tried the anytime
package, but that produced NA
s in a similar fashion.
I've made sure that the column doesn't contain any NA
s or empty strings, and I don't receive any error message.