this is the function for cashflow
analyse.cf<- function(cf,rate){ cf$return <- cf$inflow - cf$outflow cf$n <- cf$year- cf$year[1] cf$pvf <-