Re: [R] Shifting of Principal amount while calculating Present Value

2010-08-28 Thread Allan Engelhardt
Matrix operations work "the other way" to what you expect on rows and columns. Try ## Your data: time <- c(1, 2, 3) # Please don't use `t' as a variable name cash_flow <- c(7, 7, 107) zero_rate <- data.frame(rating=factor(c("AAA","AA","A","B")), year1=c(3.60, 3.65, 3.72

[R] Shifting of Principal amount while calculating Present Value

2010-08-20 Thread Sarah Sanchez
Dear R Helpers I have following data - cash_flow = c(7, 7, 107)  # 107 = Principle 100 + interest of 7% t = c(1,2,3) and zero rate table as rating year1   year2   year3 AAA    3.60    4.17  4.73 AA  3.65    4.22