instrument.table: Create data.frame with attributes of all instruments

Description Usage Arguments Details Value Author(s) See Also Examples

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

1
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

buildHierarchy, instrument

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)

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