xnpv: Net Present Value of an irregular cashflow (NPV)

Description Usage Arguments Examples

View source: R/CfFuncs.R

Description

Net Present Value of an irregular cashflow (NPV)

Usage

1
xnpv(i, cf, d, tau = NULL, comp_freq = 1)

Arguments

i

The rate used to discount the cashflow

cf

The cashflow

d

The dates when each cashflow occurs. Same length as the cashflow. Only used if tau is NULL. Assumes act/365 fractions

tau

The year fractions when each cashflow occurs. Same length as the cashflow

comp_freq

The compounding frequency used. Most relevant cases are 1 for yearly, 2 twice a year, 4 quarterly, 12 monthly, 0 no compounding, Inf continuous

Examples

1
xnpv(i = 0.01, cf = c(-1, 0.5, 0.9), d = as.Date(c("2015-01-01", "2015-02-15", "2015-04-10")))

Example output

[1] 0.3969613

tvm documentation built on April 21, 2021, 9:07 a.m.