dcf: DCF – Day Count Fraction

View source: R/dcf.R

dcfR Documentation

DCF – Day Count Fraction

Description

Day Count Fraction - difference in days divided by days per year

Implemented according to 2006 ISDA Definitions.

Usage

dcf(
  date_from = Sys.Date(),
  date_to = Sys.Date(),
  convention = "ACT/365",
  silent = FALSE
)

Arguments

date_from

Start date (or a vector of dates)

date_to

End date (or a vector of dates)

convention

Interest rate convention; default is "ACT/365".

silent

Should warning messages be suppressed? Default is no.

Details

Currently implemented conventions are:

ACT/365

Actual / 365 (Fixed) - ISDA Definitions 4.16 (d)

ACT/360

Actual / 360 - ISDA Definitions 4.16 (e)

30/360

Bond Basis - ISDA Definitions 4.16 (f)

30E/360

Eurobond Basis - ISDA Definitions 4.16 (g)

Value

A fraction of year

Examples

dcf(as.Date("2019-01-01"), as.Date("2019-01-31"), convention = "30/360")


jla-data/TVM documentation built on Feb. 3, 2024, 8:48 p.m.