ts_bind: Bind Time Series

Description Usage Arguments Value See Also Examples

View source: R/ts_bind.R

Description

Combine time series to a new, single time series. ts_bind combines time series as they are, ts_chain chains them together, using percentage change rates.

Usage

1
2
3

Arguments

...

ts-boxable time series, objects of class ts, xts, data.frame, data.table, or tibble. Or a numeric vector (see examples).

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

See Also

ts_c to collect multiple time series

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
ts_bind(ts_span(mdeaths, end = "1975-12-01"), fdeaths)
ts_bind(mdeaths, c(2, 2))
ts_bind(mdeaths, 3, ts_bind(fdeaths, c(99, 2)))
ts_bind(ts_dt(mdeaths), AirPassengers)

# numeric vectors
ts_bind(12, AirPassengers, c(2, 3))

ts_chain(ts_span(mdeaths, end = "1975-12-01"), fdeaths)

ts_plot(ts_pc(ts_c(
  comb = ts_chain(ts_span(mdeaths, end = "1975-12-01"), fdeaths),
  fdeaths
)))

christophsax/tsbox documentation built on June 26, 2018, 1:13 p.m.