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.

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

make_date_xx(2017)
#> [1] "2017"
make_date_xx(2017, 4)
#> [1] "2017-Q4"
x <- make_date_xx(2017, m = 4) is_date_xx(x)
#> [1] TRUE