Learn R Programming

dint (version 2.0.0)

date_ym: A Simple S3-Class for Year-Month Dates

Description

A simple data type for storing year-month dates in a human readable integer format, e.g.: December 2012 is stored as 201212. Supports simple arithmetics (+ and -) as well formatting.

Usage

date_ym(y, m)

is_date_ym(x)

as_date_ym(x)

Arguments

y

year

m

month (optional)

x

any R object

Value

date_ym returns an object of type date_ym

is_date_ym returns TRUE or FALSE depending on whether its argument is of type date_ym or not.

as_date_ym attempts to coerce its argument to date_ym

See Also

format.date_ym(), seq.date_ym(), date_xx_arithmetic()

Other date_xx subclasses: date_yq, date_yw

Examples

Run this code
# NOT RUN {
date_ym(2013, 12)

as_date_ym(201612)

# }

Run the code above in your browser using DataLab