Description Usage Arguments Value Examples
You can coerce objects to the InterestRate
class using this method.
1 2 3 4 5 6 7 8 | as_InterestRate(x, ...)
## S3 method for class 'DiscountFactor'
as_InterestRate(x, compounding, day_basis, ...)
## S3 method for class 'InterestRate'
as_InterestRate(x, compounding = NULL,
day_basis = NULL, ...)
|
x |
object to coerce |
... |
other parameters passed to methods |
compounding |
a numeric vector representing the compounding frequency. |
day_basis |
a character vector representing the day basis associated
with the interest rate (see |
an InterestRate
object
1 2 3 4 5 | library("lubridate")
as_InterestRate(DiscountFactor(0.95, ymd(20130101), ymd(20140101)),
compounding = 2, day_basis = "act/365")
as_InterestRate(InterestRate(c(0.04, 0.05), c(2, 4), 'act/365'),
compounding = 4, day_basis = 'act/365')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.