convert_from_modelbuilder: Convert modelbuilder list object to list for modeldiagram

View source: R/convert_from_modelbuilder.R

convert_from_modelbuilderR Documentation

Convert modelbuilder list object to list for modeldiagram

Description

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.

Usage

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

## Not run: 
#loading a model file that was made with **modelbuilder**
mbmodel <- readRDS('SIR_model.Rds')
mbmodel_structure <- convert_from_modelbuilder(mbmodel)

## End(Not run)

andreashandel/modeldiagram documentation built on July 31, 2023, 10:05 a.m.