Design Principles for {simulist}

This vignette outlines the design decisions that have been taken during the development of the {simulist} R package, and provides some of the reasoning, and possible pros and cons of each decision.

This document is primarily intended to be read by those interested in understanding the code within the package and for potential package contributors.

Scope

The {simulist} package aims to simulate data on infectious disease outbreaks, primarily line list data, but also contacts data. Each of these output types have an associated exported function: sim_linelist() and sim_contacts(). There is also a function to simulate and output both of these data types, sim_outbreak(). This latter function is useful for interoperability with the {epicontacts} R package (see visualisation vignette), and provides linked line list and contacts datasets, which are common in outbreaks, such as the MERS dataset within the {outbreaks} R package.

Output

The simulation functions either return a <data.frame> or a list of <data.frame>s. This consistency across functions of a well-known data structure makes it easy to understand for users.

Package architecture

Design decisions

Dependencies

The aim is to restrict the number of dependencies to a minimal required set for ease of maintenance. The current hard dependencies are:

{stats} is distributed with the R language so is viewed as a lightweight dependency, that should already be installed on a user’s machine if they have R. {checkmate} is an input checking package widely used across Epiverse-TRACE packages. {epiparameter} is used to easily access epidemiological parameters from the package’s library, the package is currently unstable and actively developed, however, by using it in another package it can inform the development path of {epiparameter}. {randomNames} provides a utility function for generating random names for case and contact data. The functionality could be replicated in {simulist}, however the {randomNames} package is maintained and contains a range of name generation settings which warrants its use as a dependency.

The soft dependencies (and their minimum version requirements) are:

{knitr}, {rmarkdown}, are all used for generating documentation. {spelling} and {testthat} are used for testing the code base. {ggplot2} is used for plotting within the vignettes. {incidence2} and {epicontacts} are used in vignettes to demonstrate interoperability with downstream packages, with a focus on data visualisation.

Contribute

There are no special requirements to contributing to {simulist}, please follow the package contributing guide.