coerce_date | R Documentation |
Provides consistent coercion of inputs to IDate with error handling
coerce_date(dates = NULL)
dates |
A vector-like input, which the function attempts
to coerce via |
If any of the elements of dates
cannot be coerced,
this function will result in an error, indicating all indices
which cannot be coerced to IDate.
Internal methods of epinowcast assume dates are represented as IDate.
An IDate vector.
Utility functions
aggregate_rolling_sum()
,
coerce_dt()
,
date_to_numeric_modulus()
,
get_internal_timestep()
,
is.Date()
,
stan_fns_as_string()
# works
coerce_date(c("2020-05-28", "2020-05-29"))
# does not, indicates index 2 is problem
tryCatch(
coerce_date(c("2020-05-28", "2020-o5-29")),
error = function(e) {
print(e)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.