50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

businessPlanR (version 0.1-0)

model2df: Convert model from list to data frame

Description

Converting a model from list format into a data frame makes it easier to work with nested sub-positions, and to check the model for completeness.

Usage

model2df(model = get_model(), factorize = TRUE)

# S4 method for list model2df(model = get_model(), factorize = TRUE)

Value

A data frame, representing the model structure that was defined with table_model.

Arguments

model

A named list describing a transaction model.

factorize

Logical, whether columns not representing a transaction type should be returned as a factor.

Details

The list provided must have named entries which form the top level of the transaction model. Values are in turn a list with optional named arguments:

  • subpos A named list, nested sub-position to this level, structured like any higher level position.

  • carry Name of a previous position of the same level, its value is used as the starting value of this position.

  • revenue Character vecotor of valid revenue types, their values are added to the position total.

  • expense Character vecotor of valid expense types, their values are subtracted from the position total.