date_xx: A Superclass For All dint Objects

Description Usage Arguments Value Examples

Description

Superclass for date_yq, date_ym, date_yw, and date_y.

make_date_xx can be used to create such objects when it is not know if month or quarter information is available.

is_date_xx() checks for date_xx objects.

date_xx() is an internally used constructor that should only be used by developers aspiring to extend the dint package.

Usage

1
2
3
4
5
date_xx(x, subclass)

make_date_xx(y, q = NULL, m = NULL)

is_date_xx(x)

Arguments

x

Any R object

subclass

subclass to assign

y, q, m

Year, quarter, month. q and m are optional and at least one of them must be NULL.

Value

a date_xx Object, except for is_date_xx() which returns TRUE or FALSE

a date_xx Object for date_xx(), make_date_xx

is_date_xx() returns TRUE or FALSE depending on whether its argument is of type date_xx or not.

Examples

1
2
3
4
5
make_date_xx(2017)
make_date_xx(2017, 4)
x <- make_date_xx(2017, m = 4)

is_date_xx(x)

dint documentation built on May 2, 2019, 2:01 p.m.