cf_make_full_table: Assemble the full cash-flow table (discounted cash flow and...

View source: R/dcf.R

cf_make_full_tableR Documentation

Assemble the full cash-flow table (discounted cash flow and debt)

Description

Builds an annual table by merging operating cash flows from a discounted cash flow model with a debt schedule; standardises gross effective income (GEI) and net operating income (NOI), computes post-debt cash flows, the equity cash flow, and discounted equity cash flows. Enforces a minimal contract on expected columns on both inputs.

Usage

cf_make_full_table(dcf, schedule)

Arguments

dcf

A list containing at least an element cashflows (data.frame or tibble) with one row per year and the following columns:

  • year (integer, 0 = acquisition date),

  • net_operating_income (numeric),

  • capex (numeric, optional),

  • free_cash_flow (numeric, pre-debt cash flow),

  • sale_proceeds (numeric, sale proceeds in the exit year, 0 otherwise),

  • discount_factor (numeric, strictly positive discount factor).

If gei or noi are missing, they are derived according to the convention: gei := net_operating_income and noi := gei - opex. If opex is missing, it is set to 0.

schedule

A data.frame or tibble of the debt schedule with one row per year and the required columns:

  • year (integer, aligned with dcf$cashflows$year),

  • debt_draw (numeric, drawdown; typically positive at year == 0),

  • interest (numeric),

  • amortization (numeric),

  • payment (numeric, debt service = interest + amortization; must be 0 at year == 0),

  • arrangement_fee (numeric, upfront or recurring fees),

  • outstanding_debt (numeric, end-of-period outstanding balance).

Details

Invariants and checks:

  • Stop if required columns are missing on the Discounted Cash Flow (DCF) or the debt side.

  • Stop if payment[year == 0] != 0.

  • Warn if debt_draw[year == 0] <= 0.

Value

A merged tibble (join on year) containing:

  • all input columns from the Discounted Cash Flow (DCF) and the debt schedule,

  • df (alias of discount_factor),

  • cf_pre_debt (= free_cash_flow),

  • cf_post_debt (= free_cash_flow - payment - arrangement_fee + debt_draw),

  • equity_flow (= cf_post_debt; sale proceeds are already embedded in free_cash_flow at the exit year),

  • equity_disc (= equity_flow / df).

Examples

cf <- tibble::tibble(
  year = 0:2,
  net_operating_income = c(NA, 120, 124),
  opex = c(0, 20, 21),
  capex = c(0, 5, 5),
  free_cash_flow = c(-100, 95, 98),
  sale_proceeds = c(0, 0, 150),
  discount_factor = c(1, 1.05, 1.1025)
)
dcf <- list(cashflows = cf)

schedule <- tibble::tibble(
  year = 0:2,
  debt_draw = c(60, 0, 0),
  interest = c(0, 3, 2),
  amortization = c(0, 10, 50),
  payment = interest + amortization,
  arrangement_fee = c(0.6, 0, 0),
  outstanding_debt = c(60, 50, 0)
)

res <- cf_make_full_table(dcf, schedule)
res


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