About EpiModel Gallery

Getting Started

Prerequisites

  • R >= 4.5
  • EpiModel >= 2.6.0

Install EpiModel from CRAN:

install.packages("EpiModel")

Running an Example

Clone the repository, then run any example from the project root:

source("examples/si-vital-dynamics/model.R")

Or from the command line:

Rscript examples/si-vital-dynamics/model.R

Running All Examples

bash test.sh

Contributing

Contributions of new gallery examples are welcome! To contribute:

  1. Fork the repository on GitHub.
  2. Create a new subdirectory under examples/ containing:
    • model.R — main script for network estimation and simulation
    • module-fx.R — custom module functions
    • index.qmd — annotated Quarto document
  3. Include the standard unit test lines near the top of model.R (see existing examples).
  4. Verify your example passes: bash test.sh
  5. Submit a Pull Request.

Requesting New Examples

If you’d like to ask “how would you build a network model in EpiModel that does X?”, file a GitHub Issue with a detailed description.

Build Environment

The examples on this site are built and tested against the environment below, pinned with renv for reproducibility. The complete pinned set for all packages is recorded in renv.lock.

R environment
Field Value
R version R version 4.6.1 (2026-06-24)
Platform aarch64-apple-darwin23
Operating system macOS Tahoe 26.5.1
Core package versions
Package Version
dampack 1.0.2.1000
deSolve 1.42
dplyr 1.2.1
EpiModel 2.6.1
ergm 4.12.0
ergm.multi 0.3.0
network 1.20.0
networkDynamic 0.12.0
networkDynamicData 0.3.0
networkLite 1.1.0
renv 1.2.3
statnet.common 4.13.0
tergm 4.2.2

Citation

If using EpiModel for teaching or research, please include a citation:

Jenness SM, Goodreau SM and Morris M. EpiModel: An R Package for Mathematical Modeling of Infectious Disease over Networks. Journal of Statistical Software. 2018; 84(8): 1-47. doi: 10.18637/jss.v084.i08

License

MIT