knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

readsdr

Codecov test
coverage CRAN status R-CMD-check

Overview

The goal of readsdr is to bridge the design capabilities from specialised System Dynamics software with the powerful numerical tools offered by R libraries. The package accomplishes this goal by parsing .xmile files (Vensim and Stella models) into R objects to construct networks (graph theory), ODE functions for deSolve and Stan.

Installation

You can install the released version of readsdr from CRAN with:

install.packages("readsdr")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("jandraor/readsdr")

Usage

library(readsdr)
filepath <- system.file("models/", "SIR.stmx", package = "readsdr")
mdl      <- read_xmile(filepath) 

Vensim models can only be read if they are exported in the .xmile format. Sometimes, Vensim .xmile files can be problematic, where some stocks may not have flows, and flow equations are put as initial values. One way to address this issue is by copying the .mdl file to a different folder and exporting the .xmile file again. If you encounter this issue, please let the developers know at Vensim's forum.

Tutorials

For information on how to use this package, please check:

Supported builtins

^1^ Restricted to Euler integration.

^2^ These functions cannot be part of more complex mathematical expressions. That is, the auxiliary variable must only contain one smoothing function and nothing else.

^3^ Seed is ignored.

Notes

Applications

This package has been instrumental in the following works:

Acknowledgments

Thanks to:

References

Duggan, J. (2016). System Dynamics Modeling with R. Springer.



jandraor/readsdr documentation built on May 26, 2024, 5:51 p.m.