View source: R/validate_input.R
| parse_problems | R Documentation |
Reports which elements of a vector as_messydate() cannot represent, and
why. Where as_messydate() stops at the first problem, or returns NA
for text it could not read, parse_problems() inspects every element and
returns one row per failure. This is intended for checking a column of
dates before coercing it.
parse_problems(x)
x |
A vector of dates, usually character. |
A data frame with one row per problematic element and the columns
index (its position in x), input (the offending value), and
reason. A zero-row data frame means every element can be coerced.
parse_problems(c("2019-01-01", "2019-02-30", "2019-W12", "not a date"))
# a clean vector returns no rows
parse_problems(c("2019-01-01", "2019-01"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.