Skip to contents

Date and duration methods

start_day() mid_day() end_day()
Create a datey for the start, middle or end of a day
as_start_day() as_mid_day() as_end_day()
Create a datey aligned to the start, middle or end of the day specified by a fractional calendar year or another date type.
datey()
Create a datey from a calendar year (including its fractional part) or another date type
`$`(<datey>)
Extract year, month, day or day_fraction from a datey
to_ymdf() from_ymdf()
Create or decompose a datey using calendar year, month, day and day fraction
durationy()
Create a durationy from an annual duration
seq(<datey>) seq(<durationy>)
Create datey or durationy sequence vector

Properties

is_datey() is_datey_interval() is_durationy()
Is x a datey, durationy or datey_interval?
is_start_day() is_mid_day()
Is a datey the start (or end) or middle of a day?
is_leap_year()
Is x a leap year?

Conversion to years

as.double(<datey>) as.integer(<datey>)
Convert a datey to calendar years (including fractional part)
as.double(<durationy>) as.integer(<durationy>)
Convert a durationy to duration in years

Operators and statistics

Ops(<datey_type>)
Operators for datey, durationy and datey_interval
mean(<datey>) mean(<durationy>)
Mean value of datey or durationy
Summary(<datey>) Summary(<durationy>)
Minimum, maximum or range of datey or durationy

Date intervals

datey_interval() `%to%`
Create a datey_interval
is_proper() all_proper() is_collapsed() all_collapsed() any_collapsed()
Properties of an interval.
`$`(<datey_interval>)
Get the start, end or duration of a datey_interval
interval_includes() `%includes%`
Whether a datey_interval includes a datey
all_of_time
All valid datey calendar years, i.e. 1000 to 2999 inclusive.

Text parsing and printing

Utilities

c(<datey>) c(<durationy>) c(<datey_interval>)
Combine multiple datey, durationy or datey_interval vectors
`[`(<datey>) `[`(<durationy>) `[`(<datey_interval>) `[<-`(<datey>) `[<-`(<durationy>) `[<-`(<datey_interval>)
Subset datey, durationy or datey_interval vectors

NA handling