R/convert_from_modelbuilder.R
convert_from_modelbuilder.Rd
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)
A modelbuilder model object.
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
.
if (FALSE) {
#loading a model file that was made with **modelbuilder**
mbmodel <- readRDS('SIR_model.Rds')
mbmodel_structure <- convert_from_modelbuilder(mbmodel)
}