ts.union
Union and Intersection of Time Series

Description

Binds several time series together into a single multivariate time series whose time domain is the union or intersection of the time domains of the component series.

Usage

ts.union(..., dframe = FALSE) 
ts.intersect(..., dframe = FALSE) 
## S3 method for class 'ts':
cbind(..., deparse.level = 1)

Arguments

... Multiple ts objects, vectors, or matrices, of which at least one is of class ts. All time series must have the same frequency.
dframe a logical flag. If TRUE, the resulting time series is a data frame. If FALSE (the default), returns a matrix time series object of class c("mts", "ts", "matrix").
deparse.level This argument is currently ignored.

Details

The multivariate time series is returned as a matrix or data frame with a time domain that is the union or intersection of the time domains of all the series input. Missing values (NAs) are used to represent time values at which there are no observations. Any non-time-series arguments must have the same number of rows (or elements) as implied by the time series arguments: they are not padded with missing values.
cbind.ts does the same thing as ts.union: cbind(ts1, ts2, ts3) and ts.union(ts1, ts2, ts3) give identical results.
Value
returns a multivariate time series of class c("mts", "ts", "matrix").
See Also
ts, cbind
Examples
ts1 <- ts(101:106, freq=4, start=2012.75)
ts.intersect(ts1, lag(ts1, -1))
ts.union(ts1, lag(ts1, -1))
cbind(ts1, lag(ts1, -1))
Package stats version 6.1.4-13
Package Index