instrument.table {FinancialInstrument} | R Documentation |
Create data.frame with attributes of all instruments
Description
A wrapper for buildHierarchy
, that defaults to returning all attributes.
By default it looks for the instrument with the most attribute levels, and uses those attributes
for columns. If you would prefer to use the attribute levels of a given instrument to build the columns,
use attrs.of
.
Usage
instrument.table(symbols = NULL, exclude = NULL, attrs.of = NULL)
Arguments
symbols |
A vector of instrument names to include |
exclude |
A vector of names of attributes that should not be included in the returned data.frame |
attrs.of |
name of a FinancialInstrument instrument. Returned data.frame columns will be the attributes of instrument. |
Details
if there are some attributes that you do not want to be included in the returned data.frame,
specify them with exclude
.
Value
data.frame
Author(s)
Garrett See
See Also
Examples
## Not run:
currency('USD')
stock('GM','USD',exchange='NYSE')
stock('XOM','USD',description='Exxon Mobil')
instrument.table()
#Usually, currencies will not have as many attribute levels
#as other instruments, so you may want to exclude them from the table.
it <- instrument.table(exclude="USD|GM", attrs.of = "XOM") #columns created based on XOM instrument
#it <- instrument.table(exclude=c('USD','GM'), attrs.of = "XOM") #same thing
it <- instrument.table(exclude='tick_size|description|exchange')
## End(Not run)
[Package FinancialInstrument version 1.3.1 Index]