Learn R Programming

timeSeries (version 280.75)

time: timeSeries, Positions

Description

Functions and methods extracting and modifying positions of 'timeSeries' objects. The functions and methods for the Generation of 'timeSeries' Objects are:

ll{ time.timeSeries Extracts time positions from a 'timeSeries', time<-.timeSeries Assign time positions to a 'timeSeries', sample.timeSeries Resamples a 'timeSeries' object in time, sort.timeSeries Sorts reverts a 'timeSeries' object in time, rev.timeSeries Reverts a 'timeSeries' object in time, start.timeSeries Extracts start date of a 'timeSeries' object, end.timeSeries Extracts end date of a 'timeSeries' object. }

Usage

## S3 method for class 'timeSeries':
time(x, \dots)
## S3 method for class 'timeSeries':
time(x) <- value
## S3 method for class 'timeSeries':
start(x, \dots)
## S3 method for class 'timeSeries':
end(x, \dots)

## S3 method for class 'timeSeries': sample(x, \dots) ## S3 method for class 'timeSeries': sort(x, \dots) ## S3 method for class 'timeSeries': rev(x)

Arguments

method
[alignDailySeries] - the method to be used for the alignment. A character string, one of "before", use the data from the row whose position is just before the unmatched position, or "after", use the data
value
a valid value for the component of time(x).
x
[as] - a matrix type object to be converted. [as.vector][as.matrix][as.data.frame] - [applySeries] - [cut][end][mergeSeries][plot][print][rev][start] - an object of class timeSeries.
...
arguments passed to other methods.

Value

  • timeSeries read.timeSeries as.timeSeries return a S4 object of class timeSeries. seriesData seriesPositions extract the @.Data and @position slots from a timeSeries object. Thus, seriesData returns an object of class matrix, and seriesPositions returns an object of class timeDate. is.timeSeries returns TRUE or FALSE depending on whether its argument is of timeSeries type or not. aggregateSeries applySeries cutSeries mergeSeries returnSeries revSeries return a S4 object of class timeSeries. end, start return a S4 object of class timedate. These are the start and end dates of a timeSeries object. as.vector as.matrix as.data.frame these are methods which convert a S4 object of class timeSeries either to a vector, a matrix or to a data frame. plot lines points print plot and print methods for an object of class timeSeries. Note that the plot function requires the packages its and Hmisc.

Examples

Run this code
## Create dummy timeSeries:     
   X = timeSeries(matrix(rnorm(24), 12), timeCalendar())
   
## series positions -
   time(X)

Run the code above in your browser using DataLab