View source: R/buildHierarchy.R
| buildHierarchy | R Documentation |
Construct a hierarchy of instruments useful for aggregation
buildHierarchy(primary_ids, ...)
primary_ids |
A character vector of |
... |
character names of instrument attributes in top-down order. |
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
Peter Carl, Alexis Petit, Garrett See
instrument.table
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.