##
# Example usage
example <- loan(
AMOUNT = 100000, # 100.000 currency units loan
RATE = 0.05, # 5 % periodic interest
PER = 4 # 4 periods to maturity
)
print(example)
# Another example
example2 <- loan(
AMOUNT = 1000, # 1.000 currency units loan
RATE = 0.20, # 20 % periodic interest
PER = 3 # 3 periods to maturity
)
print(example2$AmortizationTable) # For amortization table
print(example2$AmortizationTable[5]) # Balance for each period
Run the code above in your browser using DataLab