Learn R Programming

FinancialMath (version 0.1.1)

NPV: 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

Value

Details

$NPV=cf0-\sum_{k=1}^n\frac{cf_k}{(1+i)^{times_k}}$

See Also

IRR

Examples

Run this code

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)

Run the code above in your browser using DataLab