Description Usage Arguments Value See Also Examples
View source: R/is-date-string.R
Checks that the input contains dates or times.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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).
1 2 3 | 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!
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.