Description Usage Arguments Value Examples
trans
transforms an object (an 'xts' for all options) by a
specific formula.
1 |
x |
'xts' object |
type |
type of transformation to perform.
|
opt |
additional options passed to the transformation |
transformed 'xts' object
1 2 3 4 5 6 7 | GDP <- fred('GDP', as_xts=TRUE) # Nominal GDP
rGDP <- trans('GDP', 'r', opt = fred('GDPDEF'))
GDPgap <- trans(rGDP, 'pdv', opt = fred('GDPPOT'))
Treas <- fred('GS10', as_xts=TRUE) # 10 year Treasury Yield
rTreas <- trans(Treas, 'r') # Real interest rate
trans(rTreas, 'i', '2011-01') # indexed to Jan 2011 = 100
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.