is_type: Is 'x' a 'datey', 'durationy' or 'datey_interval'?

is_typeR Documentation

Is x a datey, durationy or datey_interval?

Description

These methods will always return a scalar logical TRUE or FALSE:

  • is_datey() tests whether an object is a datey.

  • is_durationy() tests whether an object is a durationy.

  • is_datey_interval() tests whether an object is a datey_interval.

Usage

is_datey(x)

is_datey_interval(x)

is_durationy(x)

Arguments

x

The object to test.

Value

A logical scalar indicating whether x a datey, durationy or datey_interval as appropriate. Always FALSE or TRUE; never NULL or NA.

Examples

t <- datey(2000:2001)
t
is_datey(t)
is_datey(NULL)
is_datey(NA)

d <- durationy(0:2)
d
is_durationy(d)
is_durationy(NULL)
is_durationy(NA)

interval <- datey(2000:2001) %to% datey(2001:2002)
interval
is_datey_interval(interval)
is_datey_interval(NULL)
is_datey_interval(NA)

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