Learn R Programming

dse (version R2000.6-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(m1,m2)

Arguments

obj1
A time series object.
obj2
A time series object.

Value

  • A time series object

Details

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

See Also

tfwindow, trim.na, 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