powered by
Net Present Value of an irregular cashflow (NPV)
xnpv(i, cf, d)
The rate used to discount the cashflow. It must be an effective anual rate (EAR)
The cashflow
The dates when each cashflow occurs. Same length as the cashflow
# NOT RUN { xnpv(i = 0.01, cf = c(-1, 0.5, 0.9), d = as.Date(c("2015-01-01", "2015-02-15", "2015-04-10"))) # }
Run the code above in your browser using DataLab