getSectorETF: Identify ETFs that correspond to a given sector

Description Usage Arguments Value Note See Also Examples

View source: R/getSectorETF.R

Description

Uses getStockInfo.sector and/or cleanSector to retrieve uniform sector name for input. One of either ticker or sector must be supplied.

Usage

1
2
3
getSectorETF(ticker, sector)

getSectorETF.sector(sector)

Arguments

ticker

Character; string of a stock's ticker

sector

Character; string of a sector

Value

Character; string of sector ETF's ticker

Note

getSectorETF is a wrapper of various sub-functions. If both ticker and sector are supplied, sector will take priority. getSectorETF.sector is a helper function for getSectorETF that works on it's own.

See Also

getStockInfo.sector: to retrieve sector that corresponds to input ticker. cleanSector: to coerce sector into uniform name.

Other data retrieval functions: getHoldings.SMIF, getStockInfo, getSymbols.SMIF

Examples

1
2
3
getSectorETF(ticker = "NVDA")
getSectorETF(sector = "Consumer Non-Durables")
getSectorETF.sector("Telecom")

alec25/smif.package documentation built on May 22, 2019, 12:36 p.m.