Loan calculation system written in R