npv_irr function

Calculate Net Present Value and other economic variables

Calculate Net Present Value and other economic variables

Get the net present value, internal rate of return, and other economic variables, given cost and revenue values.

npv_irr( df, year, cost, revenue, rate, output = "full", sens_limits = c(1, 30), big_mark = ",", dec_mark = ".", prefix = "$" )

Arguments

  • df: A data frame.
  • year: Quoted name of the year variable.
  • cost: Quoted name of the costs variable.
  • revenue: Quoted name of the revenue variable.
  • rate: Numeric value of the yearly rate to be used.
  • output: Selects different output options. It can be either "full" for a list containing a sensibility plot and a data frame with a single observation and one column for each variable, or "simple" for a two column data frame with one observation for each calculated variable. Default: "simple".
  • sens_limits: Selects the rate rage used in the sensibility plot. This is a numeric vector with two elements, the initial and final rate to be used as range. These can vary between 0 and 100. Default: c(1,30).
  • big_mark: Selects thousands separator. Can be either ".", " " or ",". Default: ",".
  • dec_mark: Selects decimal separator. Can be either "," or ".". Default: ".".
  • prefix: selects the prefix for the y axis in the sensibility plot. Can be either "$" or "R$". Default: "$".

Returns

A data frame, or a list, according to output.

Examples

## Not run: library(forestmangr) data(exfm22) npv_irr(exfm22,"year","cost","revenue",rate=8.75) # To also get a sensibility plot, use npv_irr(exfm22,"year","cost","revenue",rate=8.75, output="full") ## End(Not run)

Author(s)

Sollano Rabelo Braga sollanorb@gmail.com

  • Maintainer: Sollano Rabelo Braga
  • License: MIT + file LICENSE
  • Last published: 2024-12-01