| discount | R Documentation | 
Discount a Quantity Over Time. Should be a scalar if time is specified, a vector otherwise
discount(x, r, first = FALSE, period = 1, linear = FALSE, time)
x | 
 numeric. A quantity to discount.  | 
r | 
 discount rate.  | 
first | 
 logical. Should discounting start at the first value?  | 
period | 
 Number of cycle per unit of discount rate.  | 
linear | 
 logical. Should the discount rate vary linearly along the whole period?  | 
time | 
 The cycle number.  | 
If the unit of discount rate is the year and a cycle duration is 1 month, period should be 12.
A numeric vector of the same length as x.
discount(rep(10, 5), .02)
discount(rep(10, 5), .02, first = FALSE)
 
discount(1000, .05, time = 10)
discount(1000, .05, period = 2, time = 1:10)
discount(1000, .05, period = 2, time = 1:10, linear = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.