discount: Discount time series for Net Present Value (NPV) calculation
Description
This function discounts values along a time series, applying the specified
discount rate. It can also calculate the Net Present Value (NPV), which is
the sum of these discounted values.
Usage
discount(x, discount_rate, calculate_NPV = FALSE)
Value
If calculate_NPV=TRUE, the function returns the Net Present Value
(NPV) as a numeric value. If calculate_NPV=FALSE, the time-discounted values
are returned as a numeric vector.
Arguments
x
numeric vector, typically containing time series data of costs or
benefits
discount_rate
numeric; the discount rate (in percent), expressing the
time preference of whoever is evaluating these data economically
calculate_NPV
boolean; if set to TRUE, the discounted time values are
summed, otherwise, they are returned as a vector