convert_from_modelbuilder() takes a model, stored in an Rds file, that was built with the modelbuilder package, and converts it to the format used by flowdiagramr.

convert_from_modelbuilder(mbmodel)

Arguments

mbmodel

A modelbuilder model object.

Value

A list object consisting of the two components used by prepare_diagram function. The list contains two elements:

  • model_list: A list containing variable labels and flows. This has the format needed for the first argument of prepare_diagram. single uppercase characters. Must start with uppercase.

  • model_settings: A list containing the variable names. Also sets use_varnames = TRUE. This has the format needed for the second, optional argument of prepare_diagram.

Examples

if (FALSE) {
#loading a model file that was made with **modelbuilder**
mbmodel <- readRDS('SIR_model.Rds')
mbmodel_structure <- convert_from_modelbuilder(mbmodel)
}