The InterestRate
class is designed to represent interest rates. Checks
whether: the day_basis
is valid; and the compounding
is valid. An error
is thrown if any of these are not true. The elements of each argument are
recycled such that each resulting vectors have equivalent lengths.
InterestRate(value, compounding, day_basis)
value | a numeric vector containing interest rate values (as decimals). |
---|---|
compounding | a numeric vector representing the compounding frequency. |
day_basis | a character vector representing the day basis associated
with the interest rate (see |
a vectorised InterestRate
object
#> <InterestRate> 4.00000%, SEMI-ANNUAL, ACT/365 #> <InterestRate> 5.00000%, QUARTERLY, ACT/365#> <DiscountFactor> 0.961168781237985, 2014-01-01--2015-01-01#> <InterestRate> 3.980198%, QUARTERLY, ACT/365