Learn R Programming

umx (version 4.3.0)

fin_compound_interest: Compute the value of a principle plus annual savings, at a compound interest over a number of years

Description

Allows you to determine the final value of an initial principle (with optional periodic deposits), over a number of years (yrs) at a given rate of interest.

Usage

fin_compound_interest(
  principal = 0,
  deposits = 0,
  deposit_inflator = 0,
  interest = 0.05,
  yrs = 10,
  n = 12,
  when = "beginning",
  symbol = "$",
  report = c("markdown", "html")
)

Arguments

principal

The initial investment at time 0.

deposits

Optional periodic additional investment each year.

deposit_inflator

Whether to increase the deposits over time (default 0 = no)

interest

Annual interest rate (default = .05)

yrs

Duration of the investment (default = 10).

n

Compounding intervals per year (default = 12 (monthly), 365 for daily)

when

Deposits made at the "beginning" (of each year) or "end"

symbol

Currency symbol to embed in the result.

report

"markdown" or "html"

Value

  • Value of balance after yrs of investment.

Details

None. If an amount of $5,000 is deposited into a savings account at an annual interest rate of 5%, compounded monthly, with additional deposits of $100 per month (made at the end of each month). The value of the investment after 10 years can be calculated as follows...

References

See Also

Other Miscellaneous Functions: deg2rad(), fin_percent(), rad2deg()

Examples

Run this code
# NOT RUN {
#
# Value of a principle after yrs years at 5% return, compounding monthly.
fin_compound_interest(principal = 5000, interest = 0.05, yrs = 10)
# annual compounding
fin_compound_interest(principal = 5000, interest = 0.05, yrs = 10, n=1)
#
# Value of periodic deposit of $100/yr after 10 years at rate 7% return.
fin_compound_interest(deposits = 100, interest = 0.07, yrs = 10, n = 12)
#
# Value of principal + deposit of $100/yr after 10 years at rate 7% return.
fin_compound_interest(principal = 20000, deposits = 100, interest = 0.07, yrs = 10)
#
fin_compound_interest(deposits = 20e3, interest = 0.07, yrs = 10, n=1)
# manually
sum(20e3*(1.07^(10:1))) # 295672

# $10,000 invested at the end of each year for 5 years at 6%
fin_compound_interest(deposits = 10e3, interest = 0.06, yrs = 5, n=1, when= "end")

# }

Run the code above in your browser using DataLab