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, time = seq_along(x))

Arguments

x

numeric. A quantity to discount.

r

discount rate.

first

logical. Should discouting start at the first value ?

time

numeric. Time values over which to discount, defaults to counting sequence of same length as x.

Value

A numeric vector of the same length as x.

Examples


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


PolicyAnalysisInc/heRoMod documentation built on March 23, 2024, 4:29 p.m.