interval_properties: Get the start, end or duration of a 'datey_interval'

interval_propertiesR Documentation

Get the start, end or duration of a datey_interval

Description

Get the start, end or duration of a datey_interval using the syntax ⁠$start⁠, ⁠$end⁠ or ⁠$duration⁠ respectively.

⁠$duration⁠ is the duration of the interval provided it is proper (i.e. start <= end). If the interval is improper then ⁠$duration⁠is NA_durationy_. When x is a datey_interval then x$duration is identical to durationy(x).

Usage

## S3 method for class 'datey_interval'
x$name

Arguments

x

The datey_interval.

name

Must be start, end or duration.

Value

start and end return a vector of datey; duration returns a vector of durationy.

See Also

datey_interval, interval_nature, interval_includes

Examples

  t_1 <- start_day(2001, 1, 1)
  t_2 <- start_day(2002, 2, 2)
  interval <- datey_interval(t_1, t_2)
  interval
  interval$start
  interval$end
  interval$duration

datey documentation built on July 14, 2026, 5:06 p.m.