NPV {FinancialMath} | R Documentation |
Net Present Value
Description
Calculates the net present value for a series of cash flows, and provides a time diagram of the cash flows.
Usage
NPV(cf0,cf,times,i,plot=FALSE)
Arguments
cf0 |
cash flow at period 0 |
cf |
vector of cash flows |
times |
vector of the times for each cash flow |
i |
interest rate per period |
plot |
tells whether or not to plot the time diagram of the cash flows |
Details
NPV=cf0-\sum_{k=1}^n\frac{cf_k}{(1+i)^{times_k}}
Value
The NPV.
Note
The periods in t must be positive integers.
The lengths of cf and t must be equal.
See Also
Examples
NPV(cf0=100,cf=c(50,40),times=c(3,5),i=.01)
NPV(cf0=100,cf=50,times=3,i=.05)
NPV(cf0=100,cf=c(50,60,10,20),times=c(1,5,9,9),i=.045)
[Package FinancialMath version 0.1.1 Index]