containsID | R Documentation |
RiskFactorConnector
contains a
certain 'key'For each element of the what
parameter a logical is
returned indicating whether (TRUE
) or not
(FALSE
) the RiskFactorConnector
contains an
object with the same key.
containsID(object, id, ...) ## S4 method for signature 'RiskFactorConnector,character' containsID(object, id)
object |
The |
... |
|
what |
A character (vector) containing keys to be checked |
logical
indicating whether or not a key exists
add, remove
yc <- YieldCurve() # create a YieldCurve object tenors <- c("1W", "1M", "6M", "1Y", "2Y", "5Y") rates <- c(0.001, 0.0015, 0.002, 0.01, 0.02, 0.03) set(yc, what = list(MarketObjectCode = "YC_Prim", Nodes = list(ReferenceDate = "2015-01-01", Tenors = tenors, Rates = rates))) ind <- Index() # create a ReferenceIndex object times <- c("2015-01-01", "2016-01-01", "2017-01-01", "2018-01-01", "2019-01-01") values <- c(100, 110, 120, 130, 140) set(ind, what=list(MarketObjectCode = "CHF_SMI", Data=list(Dates=times,Values=values))) fx <- FxRate() # create an FX-Rate object 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(fx, what=list(MarketObjectCode = "CHF/USD", Data=list(Dates=times,Values=values))) rf <- RFConn() # create a RiskFactorConnector object add(rf,list(yc,ind,fx)) # add all risk factors to the RiskFactorConnector containsID(rf, c("YC_Prim", "CHF_SMI", "YC_2"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.