time | R Documentation |
Functions and methods extracting and modifying positions of 'timeSeries' objects.
## S4 method for signature 'timeSeries'
time(x, ...)
## S3 replacement method for class 'timeSeries'
time(x) <- value
getTime(x)
setTime(x) <- value
value |
a valid value for the time component of |
x |
an object of class |
... |
optional arguments passed to other methods. |
time
and time<-
are generic functions with methods for
class "timeSeries"
. They get and set the time component of the
object.
getTime
and setTime
are non-generic alternatives are
non-generic wrappers of time
and time<-
, respectively.
There is another generic function time<-
defined in package
zoo. When that package is loaded its time<-
gets the
"timeSeries"
method. Also, if "time<-"
is called with an
object from class other than "timeSeries"
, the call is
dispatched to "zoo:time<-"
to apply a suitable method.
for time
and getTime
, a "timeDate"
object,
for time<-
and and setTime
, the modified
"timeSeries"
object.
## Create Dummy 'timeSeries' -
X <- timeSeries(matrix(rnorm(24), 12), timeCalendar())
## Return Series Positions -
getTime(X)
time(X)
## Add / Subtract one Day from X
setTime(X) <- time(X) - 24*3600 # sec
X
time(X) <- time(X) + 24*3600 # sec
X
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.