powered by
You can coerce objects to the DiscountFactor class using this method.
DiscountFactor
as_DiscountFactor(x, ...)# S3 method for InterestRate as_DiscountFactor(x, d1, d2, ...)
# S3 method for InterestRate as_DiscountFactor(x, d1, d2, ...)
object to coerce
other parameters passed to methods
a Date vector containing the as of date
Date
a Date vector containing the date to which the discount factor applies
a DiscountFactor object
# NOT RUN { library("lubridate") as_DiscountFactor(InterestRate(c(0.04, 0.05), c(2, 4), 'act/365'), ymd(20140101), ymd(20150101)) # }
Run the code above in your browser using DataLab