dcf_add_noi_columns: Explicitly standardise GEI and NOI columns in a Discounted...

View source: R/dcf.R

dcf_add_noi_columnsR Documentation

Explicitly standardise GEI and NOI columns in a Discounted Cash Flow (DCF) cash-flow table

Description

Guarantees the presence of numeric columns gei and noi in a cash-flow table, to make explicit the income base used for the unlevered project IRR. In this package, gei denotes gross effective income (after vacancy and rent-free effects) and noi is computed as gei - opex.

The input may provide gei directly, or a legacy column net_operating_income which is interpreted here as gei (compatibility with earlier pipelines).

Usage

dcf_add_noi_columns(cf_tab)

Arguments

cf_tab

data.frame|tibble Cash-flow table for periods 0..N, typically produced by dcf_calculate(). Required columns: opex and either gei or net_operating_income.

Value

A tibble with guaranteed numeric columns gei, noi, and pbtcf. Existing noi or pbtcf are preserved when present, but a warning is emitted if they differ from the implied identities beyond a small tolerance.

Examples

# Minimal example with a legacy column name (net_operating_income interpreted as GEI)
cf_tab <- tibble::tibble(
  year = 0:2,
  net_operating_income = c(0, 120, 124),
  opex = c(0, 20, 21)
)
dcf_add_noi_columns(cf_tab)

# Example where GEI is provided explicitly and NOI is already present
cf_tab2 <- tibble::tibble(
  year = 0:2,
  gei  = c(0, 120, 124),
  opex = c(0, 20, 21),
  noi  = c(0, 100, 103)
)
dcf_add_noi_columns(cf_tab2)

cre.dcf documentation built on April 10, 2026, 5:08 p.m.