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 (table_model) or nested sub-nodes (model_node), like subsections of this section. You can use model_node recursive to define these named nodes. Just don't forget to give each a unique name.

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 TRUE all node names used und the nested list will be looked up if they are referenced by carry somewhere down the line.

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 set_types.

expense

Optional character vector defining names defined as class expense via set_types.

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
)

[Package businessPlanR version 0.1-0 Index]