D <- \"06.12.1948\" # which is dd.mm.yyyy as.Date(D, \"%d.%m.%y\") # convert to date [1] \"2019-12-06\" # ????
To avoid remembering formats of the date we can use packaged solutions.
1) With lubridate
lubridate
lubridate::dmy(D) #[1] "1948-12-06"
2) Using anytime
anytime
anytime::anydate(D) #[1] "1948-06-12"