Learn R Programming

tsbox (version 0.3.1)

ts_c: Collect Time Series

Description

Collect time series as multiple time series.

Usage

ts_c(...)

Value

a ts-boxable object of the same class as the input. If series of different classes are combined, the class of the first series is used (if possible).

Arguments

...

ts-boxable time series, an object of class ts, xts, zoo, data.frame, data.table, tbl, tbl_ts, tbl_time, tis, irts or timeSeries.

Details

In data frame objects, multiple time series are stored in a long data frame. In ts and xts objects, time series are combined horizontally.

See Also

ts_bind, to bind multiple time series to a single series.

Examples

Run this code
head(ts_c(ts_df(EuStockMarkets), AirPassengers))

# labeling
x <- ts_c(
  `International Airline Passengers` = ts_xts(AirPassengers),
  `Deaths from Lung Diseases` = ldeaths
)
head(x)

Run the code above in your browser using DataLab