add_problems()
annotates the returned value of create_iso8601()
with
possible parsing problems. This annotation consists of a
tibble of problems, one row for each parsing
failure (see Details section).
add_problems(x, is_problem, dtc)
Either x
without any modification, if no parsing problems exist,
or an annotated x
, meaning having a problems
attribute that holds
parsing issues (see the Details section).
A character vector of date-times in ISO 8601 format; typically, the
output of format_iso8601()
.
A logical
indicating which date/time inputs are
associated with parsing failures.
A list of character
vectors of dates, times or date-times'
components. Typically, this parameter takes the value passed in ...
to
a create_iso8601()
call.
This function annotates its input x
, a vector date-times in ISO 8601
format, by creating an attribute named problems
. This attribute's value
is a tibble of parsing problems. The problematic
date/times are indicated by the logical
vector passed as argument to
is_problem
.
The attribute problems
in the returned value will contain a first column
named ..i
that indicates the date/time index of the problematic date/time
in x
, and as many extra columns as there were inputs (passed in dtc
). If
dtc
is named, then those names are used to name the extra columns,
otherwise they get named sequentially like so ..var1
, ..var2
, etc..