The mdates_duration
class introduces methods that annotate a duration or
period with representations of its uncertainty.
Usage
new_messyduration(x = character())
messyduration(x, approx_range = 0)
validate_messyduration(x, approx_range = 0)
# S3 method for class 'character'
messyduration(x, approx_range = 0)
# S3 method for class 'mdate'
messyduration(x, approx_range = 0)
Details
Most R packages handle duration and periods as exact time or date intervals.
However, this is not possible for 'messy' dates where uncertainty or
approximation might be present.
The mdates_duration
class accounts for uncertainty and approximation
in mdate
objects to return their duration as a range of possible dates.
Examples
messyduration(as_messydate(c("2010-01-01..2010-12-31", "2010-01..2010-12")))
#> 'mdates_duration' chr [1:2] "2010-01-01..2010-12-31" ...