buildHierarchy: Construct a hierarchy of instruments useful for aggregation

Description Usage Arguments Value Author(s) See Also Examples

Description

Construct a hierarchy of instruments useful for aggregation

Usage

1
buildHierarchy(primary_ids, ...)

Arguments

primary_ids

A character vector of instrument primary_ids to be included in the hierarchy list

...

character names of instrument attributes in top-down order.

Value

Constructs a data.frame that contains the list of assets in the first column and the category or factor for grouping at each level in the following columns

Author(s)

Peter Carl, Alexis Petit, Garrett See

See Also

instrument.table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# rm_instruments(keep.currencies=FALSE)
## Define some stocks
update_instruments.TTR(c("XOM", "IBM", "CVX", "WMT", "GE"), exchange="NYSE")

buildHierarchy(ls_instruments(), "type")
buildHierarchy(ls_stocks(), c("Name", "Sector"))
buildHierarchy(ls_stocks(), "Industry", "MarketCap")

## End(Not run)

FinancialInstrument documentation built on May 2, 2019, 3:41 a.m.