Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.Date.jul

Convert ti or jul objects to Dates


Description

Methods to convert ti and jul objects to class "Date" representing calendar dates.

Usage

## S3 method for class 'ti'
as.Date(x, offset = 1, ...)
## S3 method for class 'jul'
as.Date(x, origin = "1970-01-01", ...)

Arguments

x

A ti or jul object to be converted.

offset

a number between 0 and 1 specifying where in the period represented by the ti object x the desired date falls. offset = 1 gives the first second of the period and offset = 1 the last second, offset = 0.5 the middle second, and so on.

origin

a Date object, or something which can be coerced by as.Date(origin, ...) to such an object.

...

additional args passed on to as.Date.numeric

Value

An object of class "Date".

See Also

as.Date for the generic function, as.Date.numeric for the method eventually called, and Date for details of the date class.

Examples

as.Date(today())          ## invokes as.Date.ti
as.Date(jul(today() - 7)) ## a week ago, uses as.Date.jul

tis

Time Indexes and Time Indexed Series

v1.38
Unlimited
Authors
Jeff Hallman <jeffhallman@gmail.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.