Learn R Programming

rodeo - Code generator for ODE-models in R

Basic facts

rodeo is an add-on package for the R statistical computing software. It facilitates the implementation of mechanistic models built on ordinary differential equations (ODE).

  • rodeo imposes a well-known standard notation for simultaneous ODE based on the stoichiometry matrix. This notation is widely used in chemical and wastewater engineering or biogeoscience.

  • rodeo separates the conceptual model (the set of ODE) from its implementation (computer program) by means of automatic code generation. This makes models more easy (1) to understand by non-programmers, (2) to run on different platforms/environments, (3) to develop or modify, and (4) to 'archive' in times of rapidly changing software.

  • The generated code (Fortran, R) can be used with existing suites of numerical solvers, namely the R-packages deSolve for dynamic simulation and rootSolve for steady-state estimation. The use of compiled Fortran speeds up numerical integration significantly compared to a purely R-based model implementation (often by a factor between 2 and 100).

  • rodeo has with built-in support for 1-D partial differential equations (PDE) being tackled with the numerical method-of-lines.

Package contents

The package currently provides a single R6 class named just like the package (rodeo). It contains several class- and non-class methods to

  • import a conceptual model from tabular text files (or spreadsheets).
  • generate source code to be passed to an ODE-solver.
  • visualize and export basic information about a model, e.g. for documentation purposes.
  • generate a stoichiometry matrix from a set of reaction equations.
  • validate a stoichiometry matrix (mass balance check).

The package vignette provides further details.

Requirements and installation

A current installation of R is required. In order to work with rodeo in high-performance mode, one needs the tools to compile Fortran 2008 code (compiler, make utilities, etc.). These tools are typically available by default on Linux systems. Users of other systems should have a look at the Rtools.

The development version of the package can be installed directly from the github repository as shown below. For this, the devtools package is required.

# Install and load development version
library("devtools")
install_github("dkneis/rodeo")
library("rodeo")

The release version should be available on CRAN and can be installed as usual (see below). Note that the release version may lag behind the development version in terms of functionality.

# Install and load release version
install.packages("rodeo")
library("rodeo")

Copy Link

Version

Install

install.packages('rodeo')

Monthly Downloads

505

Version

0.9.2

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

David Kneis

Last Published

September 30th, 2025

Functions in rodeo (0.9.2)

plotStoichiometry

Plot Qualitative Stoichiometry Matrix
libName

Return library name
stoichiometry

Return the Stoichiometry Matrix
rodeo-class

rodeo Class
stoiCreate

Stoichiometry Matrix from Reaction Equations
stoi

Specification of Stoichiometry
setPars

Assign Values to Parameters
setVars

Assign Values to State Variables
rodeo-package

Package to Facilitate ODE-Based Modeling
vars

Declaration of Variables
scenarios

Run a zero-dimensional model, possibly for multiple scenarios
stoiCheck

Validation of a Stoichiometry Matrix
step

Numerical Integration Over a Single Time Step
funs

Declaration of Functions
buildFromText

Build a model from the contents of delimited textfiles
exportDF

Export a Data Frame as HTML/TEX Code
finalize

Clean-up a rodeo Object
forcingFunctions

Generation of Forcing Functions in Fortran
forcings_clear

Clear forcing data of a Fortran-based model
forcings_init

Initialize forcings of a Fortran-based model
libFunc

Return name of library function
compile

Generate Executable Code
buildFromWorkbook

Build a model from the contents of a workbook
dynamics

Numerical Integration
initialize

Initialize a rodeo Object
pros

Declaration of Processes
getVars

Query Values of State Variables
initStepper

Initialize Internal ODE Solver
generate

Code Generator
getPars

Query Values of Parameters
pars

Declaration of Parameters