Learn R Programming

tframe (version 2012.3-1)

splice: Splice Time Series

Description

Splice together (in time dimension) two time series objects. This function can also be used to overlay obj1 on obj2 (obj1 takes precedence). The time windows do not have to correspond.

Usage

splice(mat1,mat2, ...)
    ## S3 method for class 'default':
splice(mat1,mat2, ...)

Arguments

mat1
A time series object.
mat2
A time series object.
...
arguments to be passed to other methods (not used by the default method).

Value

  • A time series object

Details

Splice together two time series objects. The mat1 and mat2 objects should contain the same number of time series variables and be arranged in the same order. (e.g. - the first column of mat1 is spliced to the first column of mat2, etc.). If data is provided in both mat1 and mat2 for a given period then mat1 takes priority. The frequencies should be the same.

See Also

tfwindow, trimNA, tbind

Examples

Run this code
splice(ts(matrix(rnorm(24),24,1), start=c(1980,1), frequency=4),
       ts(matrix(rnorm(6),  6,1), start=c(1986,1), frequency=4))

Run the code above in your browser using DataLab