Description Usage Format Arguments Details Examples
Compute present and future value of cash flow/stream, payback period, net present value, internal rate of return, equivalent annual annuity, profitability and break even period.
1 |
An R6 class
Cash flow.
Interest rate.
Discount rate.
Number of years.
Cash flow stream.
Cost of capital.
$new()
will instantiate an object of class Cashflow
.
set_cash_flow()
will set the value for cash_flow
.
set_interest_rate()
will set the value for interest_rate
.
set_discount_rate()
will set the value for discount_rate
.
set_years()
will set the value for years
.
set_cf_stream()
will set the value for cf_stream
.
set_capital_cost()
will set the value for capital_cost
compute_fv()
will compute the future value of a cash flow.
compute_pv()
will compute the present value of a cash flow.
compute_fv_stream()
will compute the future value of a cash flow stream.
compute_pv_stream()
will compute the present value of a cash flow stream.
compute_payback_period()
will compute the payback period of a project.
compute_npv()
will compute the net present value.
compute_eaa()
will compute the equivalent annual annuity.
compute_profit_index()
will compute profitability.
compute_break_even()
will compute the break even period.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # compute future value of a cash flow
myCashflow <- Cashflow$new()
myCashflow$set_cash_flow(100)
myCashflow$set_interest_rate(10)
myCashflow$set_years(4)
myCashflow$compute_fv()
# compute present value of a cash flow
myCashflow <- Cashflow$new()
myCashflow$set_cash_flow(39)
myCashflow$set_discount_rate(11.56)
myCashflow$set_years(7)
myCashflow$compute_pv()
# compute future value of a cash flow stream
myCashflow <- Cashflow$new()
myCashflow$set_cf_stream(c(100, 200, 200, 300))
myCashflow$set_interest_rate(10)
myCashflow$compute_fv_stream()
# compute present value of a cash flow stream
myCashflow <- Cashflow$new()
myCashflow$set_cf_stream(c(100, 200, 200, 300))
myCashflow$set_discount_rate(10)
myCashflow$compute_pv_stream()
# capital budgeting
myCashflow <- Cashflow$new()
myCashflow$set_cash_flow(c(-1000, 500, 400, 300, 200, 100))
myCashflow$set_capital_cost(10)
myCashflow$compute_payback_period()
myCashflow$compute_npv()
myCashflow$compute_eaa()
myCashflow$compute_profit_index()
myCashflow$compute_break_even()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.