Checks a set of variables can be coerced to a date and coerces them
Source:R/params_check_types.R
check_date.Rd
Checks a set of variables can be coerced to a date and coerces them
Usage
check_date(
...,
.message = "`{param}` is not a date: ({err}).",
.env = rlang::caller_env()
)
Examples
a = c(Sys.Date()+1:10)
b = format(a)
f = "1970-01-01"
g = NA
check_date(a,b,f,g)
c = c("dfsfs")
try(check_date(c,d, mean))
#> Warning: 1) 'd' is not defined in this context
#> 2) 'mean' is not defined in this context
#> Error in .check_framework(..., predicate = predicate, convert = convert, :
#> 1) `c` is not a date: (error casting to date: character string is not in a standard unambiguous format).