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

methods-as

Any to 'timeDate' Coercion


Description

Coerce and transform objects of class 'timeDate'.

Usage

## S3 method for class 'timeDate'
as.character(x, ...)

## S3 method for class 'timeDate'
as.double(x, 
    units = c("auto", "secs", "mins", "hours", "days", "weeks"), ...)
## S3 method for class 'timeDate'
as.data.frame(x, ...)

## S3 method for class 'timeDate'
as.POSIXct(x, tz = "", ...)


## S3 method for class 'timeDate'
as.POSIXlt(x, tz = "", ...)

## S3 method for class 'timeDate'
as.Date(x, method = c("trunc", "round", "next"), ...)

## Default S3 method:
as.timeDate(x, zone = "", FinCenter = "")  

## S3 method for class 'POSIXt'
as.timeDate(x, zone = "", FinCenter = "")

## S3 method for class 'Date'
as.timeDate(x, zone = "", FinCenter = "")
## S3 method for class 'timeDate'
as.timeDate(x, zone = x@FinCenter, FinCenter = "")

Arguments

FinCenter

a character with the the location of the financial center named as "continent/city".

method

a character string denoting the method how to determine the dates.

tz

inputs the time zone to POSIX objects, i.e. the time zone, zone, or financial center string, FinCenter, as used by timeDate objects.

units

a character string denoting the date/time units in which the results are desired.

x

an object of class timeDate.

zone

the time zone or financial center where the data were recorded.

...

arguments passed to other methods.

Value

as.timeDate.POSIXt returns an object of class timeDate.

as.timeDate.Date returns an object of class timeDate.

Examples

## timeDate - 
   tC = timeCalendar()

## Convert 'timeDate' to a character strings:
   as.character(tC)
   
## Coerce a 'Date' object into a 'timeDate' object:
   as.timeDate(Sys.Date())

timeDate

Rmetrics - Chronological and Calendar Objects

v3043.102
GPL (>= 2)
Authors
Diethelm Wuertz [aut], Tobias Setz [cre], Yohan Chalabi [ctb], Martin Maechler [ctb], Joe W. Byers [ctb]
Initial release
2018-02-21

We don't support your browser anymore

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