Based on period interest rate, number of periods, and instalment, this function calculates the present value of the loan such that it would be paid off fully at the end of the loan. This function is designed to be equivalent to the Excel function PV. It calculates based on a fixed interest rate, FV=0 and charging is at the end of the period. Response is rounded to 2dp
PV(rate, nper, pmt, fv = 0)
rate | The nominal interest rate per period (should be positive) |
---|---|
nper | Number of periods |
pmt | Instalment per period (should be negative) |
fv | Future value i.e. redemption amount |
pv Present value i.e. loan advance (should be positive)
PV(0.1,12,-10) # 68.14 Taken from excel#> [1] 68.14df<-data.frame(rate=c(.1,.1),nper=c(12,24),pmt=c(-10,-15)) PV(df$rate,df$nper,df$pmt) # c(68.14,134.77) Taken from excel#> [1] 68.14 134.77