Learn R Programming

heemod (version 0.3.3)

discount: Discount a Quantity Over Time

Description

This function should only take as an x argument the names of variables already defined in define_parameters or define_state, and not numeric constants.

Usage

discount(x, r, first = FALSE)

Arguments

x
numeric. A quantity to discount.
r
discount rate.
first
logical. Should the 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