Learn R Programming

dint (version 2.1.4)

date_yq: A Simple S3-Class for Year-Quarter Dates

Description

A simple data type for storing year-quarter dates in a human readable integer format, e.g.: 3.Quarter of 2012 is stored as 20123. Supports simple arithmetic operations such as + and - as well formatting.

Usage

date_yq(y, q)

is_date_yq(x)

as_date_yq(x)

Value

date_yq returns an object of type date_yq

is_date_yq returns TRUE or FALSE depending on whether its argument is of type date_yq or not.

as_date_yq attempts to coerce its argument to date_yq

Arguments

y

year

q

quarter (optional)

x

any R object

See Also

format.date_yq(), seq.date_yq(), date_xx_arithmetic()

Other date_xx subclasses: date_ym(), date_yw(), date_y()

Examples

Run this code
date_yq(2013, 3)

as_date_yq(20161)

Run the code above in your browser using DataLab