DescTools (version 0.99.8.1)

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

  • a vector with the same length as the input vector of class "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 DataCamp Workspace