tickersToXTS: Convert a character list of tickers to an xts object.

Description Usage Arguments Value Examples

View source: R/tickersToXTS.R

Description

Takes a character list of tickers and returns an xts object of the variables. Useful for creating objects after a call to dMisc::getData(). For example, typically after calling dMisc::getData() (a wrapper for quantmod::getSymbols()) you will end up with OHLC objects in .GlobalEnv. This function grabs all the variables and uses zoo::merge.zoo to bind them together in a single object. Return type is set to xts via as.xts().

Usage

1

Arguments

tickers

a character vector of symbols.

na.omit

a flag indicating whether NAs should be removed.

Value

a single xts object containing all of the prices in tickers.

Examples

1
2
3
tickers <- c("IBM","JPM")
quantmod::getSymbols(tickers)
data <- Cl(tickersToXTS(tickers)) # just closing prices

gtog/dMisc documentation built on May 17, 2019, 8:57 a.m.