| Type: | Package |
| Title: | Import System-Dynamics Models and Convert Them to Edge Lists |
| Version: | 1.0.2 |
| Description: | Imports causal and system-dynamics models from 'Vensim', 'Stella' / 'iThink' and 'Powersim Studio' ('XMILE'), 'AnyLogic' and 'GoldSim' (exported 'XML'), and converts them into a two-column edge list of cause-to-effect links. 'Vensim' models are read from their native diagram files; 'Powersim Studio' and 'GoldSim' are read from their exported 'XMILE' or 'XML'. Provides an 'RStudio' add-in with a simple point-and-click interface, together with command-line functions that return a data frame or write it to 'CSV' or 'Excel'. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| Imports: | xml2, tools, utils, stats |
| Suggests: | shiny, miniUI, rstudioapi, writexl, DT, testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| RoxygenNote: | 7.2.3 |
| NeedsCompilation: | no |
| Packaged: | 2026-07-27 18:04:19 UTC; princ |
| Author: | Taddias Prince Mpofu [aut, cre], Joel Runyu [aut] |
| Maintainer: | Taddias Prince Mpofu <princetaddy@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-08-05 09:10:08 UTC |
CLDedgelister: Import System-Dynamics Models and Convert Them to Edge Lists
Description
Imports causal / system-dynamics models from Vensim, Stella / iThink, Powersim Studio, AnyLogic and GoldSim, and converts them into a two-column INPUT -> OUTPUT edge list.
Author(s)
Maintainer: Taddias Prince Mpofu princetaddy@gmail.com
Authors:
Joel Runyu
Import a model and convert it to an edge list (RStudio addin)
Description
Opens a small window to pick a Vensim, Stella, Powersim, AnyLogic or
GoldSim model, preview the resulting INPUT -> OUTPUT edge list, and
optionally save it as CSV or Excel. The chosen edge list is returned as a
data.frame when the gadget closes, so it can be captured with
el <- cld_edgelist_addin().
Usage
cld_edgelist_addin()
Value
A data.frame of INPUT/OUTPUT edges (invisibly NULL if
cancelled). When launched from the RStudio Addins menu the result is
returned to the console.
Supported model formats
Description
Supported model formats
Usage
cld_formats()
Value
A character vector of the format labels the package understands.
Examples
cld_formats()
Convert a system-dynamics model file to an edge list
Description
Reads a model from Vensim, Stella / iThink, Powersim Studio, AnyLogic or GoldSim and returns a two-column data.frame of INPUT (cause) and OUTPUT (effect) links — the same edge list produced by the SDM Network Analyzer.
Usage
model_to_edgelist(path, format = NULL)
Arguments
path |
Path to the model file. |
format |
One of |
Value
A data.frame with columns INPUT and OUTPUT. Node
diagram positions, when available, are attached as
attr(x, "positions").
Examples
# Convert the bundled example Vensim model to an edge list
mdl <- system.file("extdata", "example_model.mdl", package = "CLDedgelister")
el <- model_to_edgelist(mdl)
head(el)
Convert a model file and write the edge list to disk
Description
Convert a model file and write the edge list to disk
Usage
model_to_edgelist_file(path, out_path = NULL, format = NULL)
Arguments
path |
Path to the model file. |
out_path |
Output file (.csv or .xlsx). If |
format |
See |
Value
(invisibly) the edge list data.frame.
Examples
mdl <- system.file("extdata", "example_model.mdl", package = "CLDedgelister")
out <- tempfile(fileext = ".csv")
model_to_edgelist_file(mdl, out)