Discount a Quantity Over Time

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)
#> [1] 10.000000 9.803922 9.611688 9.423223 9.238454
discount(rep(10, 5), .02, first = FALSE)
#> [1] 10.000000 9.803922 9.611688 9.423223 9.238454