valueAt | R Documentation |
ForeignExchangeRate,ReferenceIndex
object at
a certain point in timeForeignExchangeRate,ReferenceIndex
risk
factors define the dynamics of the respective risk factor
over time. valueAt
computes or retrieves the value
of this risk factor at a future point in time.
valueAt(object, at, ...) ## S4 method for signature 'ForeignExchangeRate,character' valueAt(object, at, ...) ## S4 method for signature 'ReferenceIndex,character' valueAt(object, at, ...)
object |
An object of class |
at |
The point in time at which to return the value |
... |
numeric The value of the respective risk factor at the specified point in time
# create an FX-Rate object fx <- FxRate() # define time stamps and values times <- c("2015-01-01", "2016-01-01", "2017-01-01", "2018-01-01", "2019-01-01") values <- c(1.04, 1.05, 1.2, 1.0, 0.9) # set the MarketObjectCode and TimeSeries set(fx, what = list(MarketObjectCode = "CHF/USD", TimeSeries = list(Dates=times,Values=values))) # get the MarketObjectCode get(fx, "MarketObjectCode") # get values of the risk factor at certain times valueAt(fx, "2016-01-01") valueAt(fx, c("2016-01-01", "2018-07-01", "2018-07-01"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.