File: methods-as.Rd

package info (click to toggle)
r-cran-timedate 2120.90-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,692 kB
  • ctags: 4
  • sloc: makefile: 13
file content (118 lines) | stat: -rw-r--r-- 2,681 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
\name{as.timeDate}

\title{Any to 'timeDate' Coercion}

\alias{Any to 'timeDate' Coercion}
\alias{as.character.timeDate}
\alias{as.double.timeDate}
\alias{as.list.timeDate}
\alias{as.data.frame.timeDate}
\alias{as.POSIXct.timeDate}
\alias{as.POSIXlt.timeDate}
\alias{as.Date.timeDate}
\alias{as.timeDate}
\alias{as.timeDate.default}
\alias{as.timeDate.POSIXt}
\alias{as.timeDate.Date}
\alias{as.timeDate.timeDate}
\alias{coerce,ANY,timeDate-method}
\alias{coerce,Date,timeDate-method}
\alias{coerce,POSIXt,timeDate-method}
\alias{coerce,timeDate,character-method}
\alias{coerce,timeDate,numeric-method}
\alias{coerce,timeDate,data.frame-method}
\alias{coerce,timeDate,list-method}
\alias{coerce,timeDate,POSIXct-method}
\alias{coerce,timeDate,POSIXlt-method}
\alias{coerce,timeDate,Date-method}

\description{
  
  Coerce and transform objects of class 'timeDate'.
  
}


\usage{
\method{as.character}{timeDate}(x, \dots)

\method{as.double}{timeDate}(x, 
    units = c("auto", "secs", "mins", "hours", "days", "weeks"), ...)
\method{as.data.frame}{timeDate}(x, \dots)

\method{as.POSIXct}{timeDate}(x, tz = "", \dots)

% \S4method{as.POSIXlt}{timeDate}(x, tz = "", \dots)
\method{as.POSIXlt}{timeDate}(x, tz = "", \dots)

\method{as.Date}{timeDate}(x, method = c("trunc", "round", "next"), \dots)

\method{as.timeDate}{default}(x, zone = "", FinCenter = "")  

\method{as.timeDate}{POSIXt}(x, zone = "", FinCenter = "")

\method{as.timeDate}{Date}(x, zone = "", FinCenter = "")
\method{as.timeDate}{timeDate}(x, zone = x@FinCenter, FinCenter = "")  
}


\arguments{
  \item{FinCenter}{
    a character with the the location of the  
    financial center named as "continent/city". 
  }

  \item{method}{
    a character string denoting the method how to determine the
    dates.
  }    
  
  \item{tz}{
    inputs the time zone to POSIX objects, i.e. the time zone, 
    \code{zone}, or financial center string, \code{FinCenter}, 
    as used by \code{timeDate} objects.
  }

  \item{units}{
    a character string denoting the date/time units in which the 
    results are desired.
  }

  \item{x}{
    an object of class \code{timeDate}.
  }

  \item{zone}{
    the time zone or financial center where the data were recorded.
  }

  \item{\dots}{
    arguments passed to other methods.
  }

}


\value{
  
  \code{as.timeDate.POSIXt} returns an object of class \code{timeDate}.
  
  \code{as.timeDate.Date} returns an object of class \code{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())
}


\keyword{chron}