Learn R Programming

DescTools (version 0.99.19)

Date: Create a Date From Numeric Representation

Description

Create a date out of either year, month and day supplied by single values or out of one single numeric valu in the form yyyymmdd.

Usage

Date(year, month = NA, day = NA)

Arguments

year, month, day
numerical values to specify a day. If month and day are omitted the function tries to interpret year as yearmonthday (yyyymmdd) long integer value.

Value

"Date".

Details

All arguments are recycled if necessary.

The function is a convenience wrapper for ISOdate, which yields a datetime object, which again is an overkill, if only dates are needed.

See Also

ISOdate

Examples

Run this code
Date(2011, 3, 1:15)

Date(20120305:20120315)

Run the code above in your browser using DataLab