assert_all_are_date_strings {assertive.datetimes} | R Documentation |
Checks that the input contains dates or times.
assert_all_are_date_strings(x, format = "%F %T", na_ignore = FALSE, severity = getOption("assertive.severity", "stop")) assert_any_are_date_strings(x, format = "%F %T", na_ignore = FALSE, severity = getOption("assertive.severity", "stop")) is_date_string(x, format = "%F %T", .xname = get_name_in_parent(x))
x |
Input to check. |
format |
Expected format of the dates. See
|
na_ignore |
A logical value. If |
severity |
How severe should the consequences of the assertion be?
Either |
.xname |
Not intended to be used directly. |
A logical vector that is TRUE
when the input contains valid
dates or times.
strptime
for specifying formats, and the
lubridate
package for automatic guessing of date formats (and other
date manipulation functions).
x <- c("9999-12-31 23:59:59", "wednesday", NA) is_date_string(x) assert_all_are_date_strings("01Aug1979", format = "%d%b%Y") #My DOB!