Get and Set Time stamps of a 'timeSeries'

Share:

Description

Functions and methods extracting and modifying positions of 'timeSeries' objects.

Usage

1
2
3
4
5
6
7
getTime(x)         
setTime(x) <- value

## S4 method for signature 'timeSeries'
time(x, ...)
## S3 replacement method for class 'timeSeries'
time(x) <- value

Arguments

value

a valid value for the component of time(x).

x

an object of class timeSeries.

...

optional arguments passed to other methods.

Value

Returns a 'timeDate' object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
   
## 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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.