model2df-methods: Convert model from list to data frame

model2dfR Documentation

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 signature 'list'
model2df(model = get_model(), factorize = TRUE)

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.

Value

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


businessPlanR documentation built on Aug. 15, 2023, 5:09 p.m.