R/compoundInterest.R

"compoundInterest" <-
function(interest, periods=1, 
                frequency=1, net.value=FALSE){
#
  cI <- exp(periods*frequency*
      log(1+interest/frequency))
  cI[frequency==Inf] <- exp(periods*interest)
#
  if(net.value)cI-(net.value)
  cI
}

Try the FinTS package in your browser

Any scripts or data that you put into this service are public.

FinTS documentation built on May 29, 2024, 4:24 a.m.