## a vector of commonly used notations in the database to represent
## dates. Most frequent format is %m/%d/%Y
char_date <- c("5-19-1987 ", "5/dd/2021", "3/19/yyyy", "1985", "mm/19/1999",
"October 2004", "nr/nr/2015")
as_date_ecotox(char_date)
## Set unspecified days to 15:
as_date_ecotox(char_date, dd = 15L)
## Unspecified days should result in NA:
as_date_ecotox(char_date, dd = -1L)
## Set unspecified months to 6:
as_date_ecotox(char_date, mm = 6L)
## Set generically unspecified value to 6:
as_date_ecotox(char_date, nr = 6L)
Run the code above in your browser using DataLab