# NOT RUN {
# 1. Value of a principal after yrs years at 5% return, compounding monthly.
# Report in browser as a nice table of annual returns and formatted totals.
fin_interest(principal = 5000, interest = 0.05, rep= "html")
# }
# NOT RUN {
# Report as a nice markdown table
fin_interest(principal = 5000, interest = 0.05, yrs = 10)
# 2 What rate is needed to increase principal to final value in yrs time?
fin_interest(final = 1.4, yrs=5)
fin_interest(principal = 50, final=200, yrs = 5)
# 3. What's the value of deposits of $100/yr after 10 years at 7% return?
fin_interest(deposits = 100, interest = 0.07, yrs = 10, n = 12)
# 4. What's the value of <U+00A3>20k + <U+00A3>100/yr over 10 years at 7% return?
fin_interest(principal= 20e3, deposits= 100, interest= .07, yrs= 10, symbol="<U+00A3>")
# 5. What is $10,000 invested at the end of each year for 5 years at 6%?
fin_interest(deposits = 10e3, interest = 0.06, yrs = 5, n=1, when= "end")
# 6. What will <U+00A3>20k be worth after 10 years at 15% annually (n=1)?
fin_interest(deposits=20e3, interest = 0.15, yrs = 10, n=1, baseYear=1)
# $466,986
# manual equivalent
sum(20e3*(1.15^(10:1))) # 466985.5
# 7. Annual (rather than monthly) compounding (n=1)
fin_interest(deposits = 100, interest = 0.07, yrs = 10, n=1)
# 8 Interest needed to increase principal to final value in yrs time.
fin_interest(principal = 100, final=200, yrs = 5)
# }
Run the code above in your browser using DataLab