Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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, ...)
    ## Default S3 method:
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).

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.

Value

A time series object

See Also

Examples

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))

tframe

Time Frame Coding Kernel

v2015.12-1.1
GPL-2
Authors
Paul Gilbert <pgilbert.ttv9z@ncf.ca>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.