{
library(tidyr)
##### Example 1 -------------------------------------------------------------
# Non-ambiguous dates ----------------------------------------------------
time <-
tibble(time = c(
"1983-07-19",
"2003-01-14",
"2010-09-29",
"2023-12-12",
"2009-09-03",
"1509-11-30",
"1809-01-01"))
guess_date_format(time)
##### Example 2 -------------------------------------------------------------
# Ambiguous dates ----------------------------------------------------
time <-
tibble(time = c(
"1983-19-07",
"1983-10-13",
"2009-09-03",
"1509-11-30"))
guess_date_format(time)
##### Example 3 -------------------------------------------------------------
# Non date format dates --------------------------------------------------
time <-
tibble(time = c(
"198-07-19",
"200-01-14",
"201-09-29",
"202-12-12",
"2000-09-03",
"150-11-3d0",
"180-01-01"))
guess_date_format(time)
}
Run the code above in your browser using DataLab