R/draw.discounted.cash.R

Defines functions draw_discounted_cash

Documented in draw_discounted_cash

#' Draw Discounted Cash vs Time
#' 
#' @name draw.discounted.cash
#' 
#' @aliases draw_discounted_cash
#' 
#' @param discounted.cash A vector with discounted cash flow for each timestamp.
#' @param smooth Multiplier used to smooth line
#' @param title Used to define the title of plot
#' 
#' @export draw.discounted.cash
#' 
#' @family draw
#' 
draw.discounted.cash <- draw_discounted_cash <-
  function(discounted.cash, smooth = 1, title = "Discounted Cash vs Time") {
    
    png("output/draw.discounted.cash.png");
    
    plot(spline(c(0, discounted.cash), n = smooth*length(c(0, discounted.cash))), 
         type="l", pch=20, xaxt='n',
         xlab="Time", ylab="Discounted Cash")
    title(title)
    abline(h=1)
    
    dev.off()
  }
antoanne/ifmFramework documentation built on Aug. 5, 2023, 6:03 p.m.