x <- c("2020-12-17", NA_character_, "", "2020-12-UN", "2020-12-UN",
"2019-Unknown-00", "UNK-UNK-UNK", "1991-02-UN", " ",
"2020January20")
data.frame(
x = x,
min = date_from_partial(x),
max = date_from_partial(x, method = "max"),
year = date_from_partial(x, year_replacement = 1900)
)
Run the code above in your browser using DataLab