Learn R Programming

heemod (version 0.9.1)

discount: Discount a Quantity Over Time

Description

Discount a Quantity Over Time

Usage

discount(x, r, first = FALSE)

Arguments

x
numeric. A quantity to discount.
r
discount rate.
first
logical. Should discouting start at the first value ?

Value

A numeric vector of the same length as x.

Examples

Run this code

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

Run the code above in your browser using DataLab