as_DiscountFactor: Coerce to DiscountFactor

Description Usage Arguments Value Examples

View source: R/interest-rate-classes.R

Description

You can coerce objects to the DiscountFactor class using this method.

Usage

1
2
3
4
as_DiscountFactor(x, ...)

## S3 method for class 'InterestRate'
as_DiscountFactor(x, d1, d2, ...)

Arguments

x

object to coerce

...

other parameters passed to methods

d1

a Date vector containing the as of date

d2

a Date vector containing the date to which the discount factor applies

Value

a DiscountFactor object

Examples

1
2
3
library("lubridate")
as_DiscountFactor(InterestRate(c(0.04, 0.05), c(2, 4), 'act/365'),
  ymd(20140101), ymd(20150101))

imanuelcostigan/fmbasics documentation built on Dec. 6, 2019, 9:48 a.m.