ts_pick: Pick Series (Experimental)

Description Usage Arguments Value Examples

View source: R/ts_pick.R

Description

Pick (and optionally rename) series from multiple time series.

Usage

1

Arguments

x

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

...

character string(s), names of the series to be picked. If arguments are named, the series will be renamed.

Value

a ts-boxable time series, with the same class as the input.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Interactive use

ts_plot(ts_pick(
  EuStockMarkets, 
  `My Dax` = "DAX", 
  `My Smi` = "SMI"
))
head(ts_pick(EuStockMarkets, c(1, 2)))
head(ts_pick(EuStockMarkets, `My Dax` = 'DAX', `My Smi` = 'SMI'))


# Programming use
to.be.picked.and.renamed <- c(`My Dax` = "DAX", `My Smi` = "SMI")
head(ts_pick(EuStockMarkets, to.be.picked.and.renamed))

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