table_model {businessPlanR} | R Documentation |
Define a model node for business plan tables
Description
Tool to define a (possibly nested) model for generating tables for our business plan. The "model" is in fact a nested list.
Usage
table_model(..., valid_types, check_carry = TRUE)
model_node(carry, ..., revenue, expense)
Arguments
... |
Optional named lists of nodes ( |
valid_types |
Optional character string, the name of the type set to use for checking if all used revenue and expense names are actually valid. |
check_carry |
Logical,
if |
carry |
Optional character string, the name of another already defined named list, probably at the same level. The sum of that list will then be used as the initial value for the calculation of this node. |
revenue |
Optional character vector defining names defined as class revenue via |
expense |
Optional character vector defining names defined as class expense via |
Details
If you define nested levels,
you want to probably only want to combine this node with carry
and neither revenue
nor expense
.
Value
A nested, named list.
Examples
my_model <- table_model(
"Basic Income"=model_node(
revenue="Sale"
),
"Basic Costs"=model_node(
carry="Basic Income",
expense=c(
"Goods",
"Operation"
)
),
valid_types="default",
check_carry=TRUE
)