discount: Discount a Quantity Over Time

View source: R/utils.R

discountR Documentation

Discount a Quantity Over Time

Description

Discount a Quantity Over Time

Usage

discount(x, r, first = FALSE, period = 1)

Arguments

x

numeric. A quantity to discount.

r

discount rate.

first

logical. Should discouting start at the first value ?

period

Number of cycle per unit of discount rate.

Value

A numeric vector of the same length as x.

Examples


discount(rep(10, 5), .02)
discount(rep(10, 5), .02, first = FALSE)


pierucci/heemod documentation built on July 17, 2022, 9:27 p.m.