Learn R Programming

dint (version 2.1.4)

date_y: A Simple S3-Class for Years

Description

A simple data type for storing years. A date_y object is just an integer with an additional class attribute.

Usage

date_y(y)

is_date_y(x)

as_date_y(x)

Value

date_y returns an object of type date_y

is_date_y returns TRUE or FALSE depending on whether its argument is of type date_y or not.

as_date_m attempts to coerce its argument to date_y type

Arguments

y

year

x

any R object

See Also

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

Examples

Run this code
date_y(2013)

as_date_y(2016)

Run the code above in your browser using DataLab