| run_case | R Documentation |
User-facing single entry point. Accepts either an in-memory config list
or a config_file path to YAML. Both routes share the same validation
and normalization pathway, ensuring identical downstream behavior.
run_case(
config = NULL,
config_file = NULL,
debt_type = NULL,
ltv_base = c("price_di", "price_ht", "value")
)
config |
Optional list configuration following the YAML grammar. |
config_file |
Optional path to a YAML configuration file. If both
|
debt_type |
Optional debt schedule type to use ( |
ltv_base |
Base for loan-to-value (LTV) and initial principal. One of
|
The function centralizes user ergonomics:
Reads either a list or a YAML file.
Validates and normalizes with cfg_validate() and cfg_normalize().
Computes the unlevered discounted cash flow (DCF), builds a debt schedule, computes leveraged metrics, and adds credit ratios to the full cash-flow table.
Handles capitalized arrangement fees by adjusting the scheduled principal to avoid double-counting.
A list containing pricing (acquisition price net of taxes, acquisition costs, and acquisition price including costs), all-equity metrics, leveraged metrics, a comparison table, the full cash-flow table with credit ratios, and selected configuration flags.
# R list route
cfg <- dcf_spec_template()
cfg$leases <- list(
list(
unit = "U",
area = 1000,
events = list(
list(
start = cfg$purchase_year,
end = cfg$purchase_year + cfg$horizon_years, # keep NOI positive in terminal year
rent = 200,
free_months = 0,
capex_sqm = 0,
vac = 0,
new_lease = 0
)
)
)
)
out <- run_case(config = cfg, debt_type = "bullet")
names(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.