duration_class: A duration class for mdates

duration_classR Documentation

A duration class for mdates

Description

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)

Arguments

x

An mdate variable with ranges.

approx_range

Range to expand approximate dates, in days. If 3, for example, adds 3 days; if -3, removes 3 days from both sides.

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.

Value

Object of class description

Examples

messyduration(as_messydate(c("2010-01-01..2010-12-31", "2010-01..2010-12")))

messydates documentation built on May 29, 2024, 2:16 a.m.