Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5637055
add cran-comments.md
joshwlambert May 29, 2026
477b5a1
update installation instructions in README
joshwlambert May 29, 2026
03dc66a
update package title and description in DESCRIPTION
joshwlambert May 29, 2026
c0f3445
update LICENSE year
joshwlambert May 29, 2026
cd12967
lowercase 'epiforecasts' in LICENSE files
joshwlambert May 29, 2026
518ec62
fix URL flagged by urlchecker::url_check()
joshwlambert May 29, 2026
318e7cb
update @pearsonca role in DESCRIPTION ctb -> aut
joshwlambert May 29, 2026
0412bb7
increment major version
joshwlambert May 29, 2026
84f0a46
desc::desc_normalize()
joshwlambert May 29, 2026
00afe28
add {spelling} spell checking to pkg and add WORDLIST file
joshwlambert Jun 1, 2026
5dc1077
fix spelling in vignettes
joshwlambert Jun 1, 2026
086a629
add hex logo, closes #129
joshwlambert Jun 1, 2026
ba68682
add hex logo to README
joshwlambert Jun 1, 2026
fbfa5f0
remove duplicated info in README
joshwlambert Jun 1, 2026
98c410a
rewrite package intro in README and add citations
joshwlambert Jun 1, 2026
9d7c07d
increase opacity of lines in README plot
joshwlambert Jun 1, 2026
c6dd06e
re-render README
joshwlambert Jun 1, 2026
43eb672
fix badge links in README.md
joshwlambert Jun 1, 2026
c5096d2
lower expected value in KS tests for outbreak_setup to remove false-p…
joshwlambert Jun 1, 2026
a4062e4
update ringbp-package.Rd
joshwlambert Jun 1, 2026
86ebed6
move scenario_sim to start of pkgdown reference page
joshwlambert Jun 1, 2026
7041aed
add pkgdown/favicon/
joshwlambert Jun 1, 2026
af84ea5
update WORDLIST
joshwlambert Jun 1, 2026
236a573
add alt-text to hex logo in README
joshwlambert Jun 1, 2026
8314a3f
"Jan" -> "jan" in Kucharski2016 citation in references.bib
joshwlambert Jun 1, 2026
cbd763a
shorten simulation demo in README to 140 days
joshwlambert Jun 1, 2026
fcf6ad5
quote citation in DESCRIPTION to avoid R CMD check spelling flag
joshwlambert Jun 1, 2026
730b4c6
add missing NEWS entry for changes in #228
joshwlambert Jun 1, 2026
c4fa11c
add CRAN-SUBMISSION to .Rbuildignore
joshwlambert Jun 5, 2026
bd2454a
remove quotes around reference in DESCRIPTION
joshwlambert Jun 7, 2026
2ab19bd
update copyright holder to ringbp authors in LICENSE files
joshwlambert Jun 7, 2026
42299c9
update cran-comments.md with resubmission points
joshwlambert Jun 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
^doc$
^docs$
^Meta$
^cran-comments\.md$
^CRAN-SUBMISSION$
72 changes: 32 additions & 40 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,48 +1,34 @@
Package: ringbp
Type: Package
Title: Simulate and evaluate contact tracing scenarios
Version: 0.1.2.9999
Package: ringbp
Title: Simulate and Evaluate Targeted Interventions in Infectious Disease
Outbreaks
Version: 1.0.0
Authors@R: c(
person("Joel", "Hellewell",
role = c("aut"),
email = "Joel.Hellewell@lshtm.ac.uk",
person("Joel", "Hellewell", , "Joel.Hellewell@lshtm.ac.uk", role = "aut",
comment = c(ORCID = "0000-0003-2683-0849")),
person("Sam", "Abbott",
role = c("aut"),
email = "contact@samabbott.co.uk",
person("Sam", "Abbott", , "contact@samabbott.co.uk", role = "aut",
comment = c(ORCID = "0000-0001-8057-8037")),
person("Amy", "Gimma",
email = "amy.gimma@lshtm.ac.uk",
role = c("aut")),
person("Tim", "Lucas",
email = "tim.lucas@leicester.ac.uk",
role = c("aut")),
person("Sebastian", "Funk",
email = "sebastian.funk@lshtm.ac.uk",
role = c("aut")),
person("Adam", "Kucharski",
email = "adam.kucharski@lshtm.ac.uk",
role = c("aut")),
person("Hugo", "Gruson",
email = "hugo.gruson@data.org",
role = c("ctb"),
person("Amy", "Gimma", , "amy.gimma@lshtm.ac.uk", role = "aut"),
person("Tim", "Lucas", , "tim.lucas@leicester.ac.uk", role = "aut"),
person("Sebastian", "Funk", , "sebastian.funk@lshtm.ac.uk", role = "aut"),
person("Adam", "Kucharski", , "adam.kucharski@lshtm.ac.uk", role = "aut"),
person("Hugo", "Gruson", , "hugo.gruson@data.org", role = "ctb",
comment = c(ORCID = "https://orcid.org/0000-0002-4094-1476")),
person("Carl A. B.", "Pearson",
email = "carl.ab.pearson@gmail.com",
role = c("ctb", "rev"),
person("Carl A. B.", "Pearson", , "carl.ab.pearson@gmail.com", role = c("aut", "rev"),
comment = c(ORCID = "0000-0003-0701-7860")),
person("Joshua W.", "Lambert",
email = "joshua.lambert@lshtm.ac.uk",
role = c("aut", "cre"),
person("Joshua W.", "Lambert", , "joshua.lambert@lshtm.ac.uk", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-5218-3046"))
)
Description: A package to simulate transmission of an infectious disease and associated efforts to trace contacts and reduce onwards transmission.
)
Description: Branching process simulation model of infectious disease
transmission with flexible parameterisation of epidemiology and
targeted interventions, including isolation, contact tracing and
quarantine, to reduce transmission, together with functions to
evaluate outbreak control. Introduced in Hellewell et al. (2020)
<doi:10.1016/S2214-109X(20)30074-7>.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd",
"roxyglobals::global_roclet"))
RoxygenNote: 7.3.3
URL: https://epiforecasts.io/ringbp/,
https://github.com/epiforecasts/ringbp
BugReports: https://github.com/epiforecasts/ringbp/issues
Depends:
R (>= 4.4.0)
Imports:
Expand All @@ -55,11 +41,17 @@ Suggests:
knitr,
rmarkdown,
roxyglobals (>= 1.0.0),
spelling,
testthat (>= 3.0.0),
tinyplot
URL: https://epiforecasts.io/ringbp, https://github.com/epiforecasts/ringbp
BugReports: https://github.com/epiforecasts/ringbp/issues
VignetteBuilder:
knitr
Config/roxyglobals/filename: globals.R
Config/roxyglobals/unique: FALSE
Config/testthat/edition: 3
VignetteBuilder: knitr
Encoding: UTF-8
Language: en-GB
LazyData: true
Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd",
"roxyglobals::global_roclet"))
RoxygenNote: 7.3.3
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2020
COPYRIGHT HOLDER: EpiForecasts
YEAR: 2020-2026
COPYRIGHT HOLDER: ringbp authors
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2020 EpiForecasts
Copyright (c) 2020-2026 ringbp authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# ringbp 0.1.2.9999
# ringbp 1.0.0

* Index cases in `outbreak_setup()` are now only isolated if they test positive (using the `test_sensitivity` parameter), as opposed to previously where all symptomatic index cases were isolated. The updated `outbreak_setup()` matches the testing pathway in `outbreak_step()`. `outbreak_setup()` gains an `interventions` argument. Addresses #231 by @joshwlambert in #232 and reviewed by @pearsonca.

* Interventions can now activate after a delay rather than being active from the start of the outbreak. The `symptomatic_traced` argument of `event_prob_opts()` and the `test_sensitivity` argument of `intervention_opts()` can now accept a `function` of time returning probabilities as well as a `numeric` scalar (constant over the simulation, as before). The function is evaluated at the contact's exposure time (`symptomatic_traced`) or the case's symptom onset time (`test_sensitivity`) in `outbreak_step()`, so contact tracing and testing can vary over time. A new internal `as_prob_function()` coerces scalar inputs to constant functions. Addresses #229 by @joshwlambert in #230 and reviewed by @pearsonca.

* The time-based stopping criterion in `outbreak_continue()` now uses the earliest exposure time of unprocessed cases rather than the latest symptom onset, so long incubation periods no longer end the simulation prematurely and changing `cap_max_days` no longer alters in-window case counts. Addresses #163 and #225 by @joshwlambert in #228 and reviewed by @pearsonca.

* Symptomatic individuals can now self-isolate without requiring a positive test. `event_prob_opts()` gains a `symptomatic_self_isolate` argument (the proportion of symptomatic cases that self-isolate, default `0`) and `delay_opts()` gains an `onset_to_self_isolation` argument, (by default a function generating `Inf` so that no individual self-isolates). A new internal `cross_check_opts()` checks that the `delay_opts()` and `event_prob_opts()` settings are mutually compatible.

In `outbreak_step()` a case's isolation time is now the earliest of three pathways: self-isolation, a positive test, and contact tracing. Tracing under `quarantine` is now exposure-based, so all traced contacts, including asymptomatic ones, are isolated when their infector is isolated regardless of symptom status (previously asymptomatic cases were never isolated); `sample_offspring()` reduces post-isolation transmission for asymptomatic cases accordingly. Addresses #212 and #227 by @joshwlambert in #213 and reviewed by @pearsonca and @sbfnk.
Expand Down
49 changes: 35 additions & 14 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
output: github_document
bibliography: vignettes/references.bib
link-citations: true
---

```{r, include = FALSE}
Expand All @@ -12,7 +14,7 @@ knitr::opts_chunk$set(
set.seed(111)
```

# `{ringbp}`: Simulate infectious disease transmission with contact tracing
# `{ringbp}`: Simulate infectious disease transmission with contact tracing <img src="man/figures/logo.svg" align="right" width="120" alt="The ringbp hex logo, showing the ringbp name underlined above a diagram of a branching process with infected (red) circles and isolated (green with a blue ring) circles" />

<!-- badges: start -->
![GitHub R package version](https://img.shields.io/github/r-package/v/{{ gh_repo }})
Expand All @@ -23,25 +25,42 @@ set.seed(111)
<!-- badges: end -->

`{ringbp}` is an R package that provides methods to simulate infectious
disease transmission in the presence of contact tracing. It was
initially developed to support a paper written in early 2020 to assess
the feasibility of controlling
COVID-19; see the [companion analysis code](https://github.com/cmmid/ringbp) and
[paper](https://doi.org/10.1016/S2214-109X(20)30074-7) for more details.
disease transmission in the presence of contact tracing. It was based on an
Ebola transmission model with ring vaccination [@Kucharski2016]. The `{ringbp}`
model was initially developed to support a paper written in early 2020 to assess
the feasibility of controlling COVID-19 [@Hellewell2020].

`{ringbp}` is an R package that provides methods to simulate infectious disease transmission in the presence of contact tracing.
It was initially developed to support a paper written in early 2020 to assess the [feasibility of controlling COVID-19](https://github.com/cmmid/ringbp).
For more details on the methods implemented here, see the associated [paper](https://doi.org/10.1016/S2214-109X(20)30074-7).
See the [companion analysis code](https://github.com/cmmid/ringbp) to reproduce
@Hellewell2020.

For more details on the methods implemented in the `{ringbp}` R package,
see the @Hellewell2020 [paper](https://doi.org/10.1016/S2214-109X(20)30074-7),
and the [package documentation](https://epiforecasts.io/ringbp/articles/).

## Installation

The current development version of `{ringbp}` can be installed from [GitHub](https://github.com/) using the `pak` package.
The package can be installed from CRAN using

```r
install.packages("ringbp")
```

You can install the development version of `{ringbp}` from
[GitHub](https://github.com/) with:

``` r
Comment thread
joshwlambert marked this conversation as resolved.
Resolved
# check whether {pak} is installed
if(!require("pak")) install.packages("pak")
pak::pak("{{ gh_repo }}")
pak::pak("epiforecasts/ringbp")
```

Alternatively, install pre-compiled binaries from [the epiforecasts R-universe](https://epiforecasts.r-universe.dev/ringbp)

``` r
install.packages("ringbp", repos = c("https://epiforecasts.r-universe.dev", "https://cloud.r-project.org"))
```


## Quick start

The main functionality of the package is in the `scenario_sim()` function.
Expand Down Expand Up @@ -77,8 +96,8 @@ res <- scenario_sim(
## whether quarantine is in effect
interventions = intervention_opts(quarantine = FALSE),
sim = sim_opts(
## don't simulate beyond 350 days
cap_max_days = 350,
## don't simulate beyond 140 days
cap_max_days = 140,
## don't simulate beyond 4500 infections
cap_cases = 4500
)
Expand All @@ -91,7 +110,7 @@ res <- scenario_sim(
ggplot(
data = res, aes(x = week, y = cumulative, col = as.factor(sim))
) +
geom_line(show.legend = FALSE, alpha = 0.3) +
geom_line(show.legend = FALSE) +
scale_y_continuous(name = "Cumulative number of cases") +
theme_bw()
```
Expand Down Expand Up @@ -155,3 +174,5 @@ All contributions to this project are gratefully acknowledged using the [`allcon
Please note that the `{ringbp}` project is released with a
[Contributor Code of Conduct](https://github.com/epiforecasts/.github/blob/main/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.

## References
79 changes: 60 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# `{ringbp}`: Simulate infectious disease transmission with contact tracing
# `{ringbp}`: Simulate infectious disease transmission with contact tracing <img src="man/figures/logo.svg" align="right" width="120" alt="The ringbp hex logo, showing the ringbp name underlined above a diagram of a branching process with infected (red) circles and isolated (green with a blue ring) circles" />

<!-- badges: start -->

Expand All @@ -15,30 +15,44 @@ MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/
<!-- badges: end -->

`{ringbp}` is an R package that provides methods to simulate infectious
disease transmission in the presence of contact tracing. It was
initially developed to support a paper written in early 2020 to assess
the feasibility of controlling COVID-19; see the [companion analysis
code](https://github.com/cmmid/ringbp) and
[paper](https://doi.org/10.1016/S2214-109X(20)30074-7) for more details.
disease transmission in the presence of contact tracing. It was based on
an Ebola transmission model with ring vaccination ([Kucharski et al.
2016](#ref-Kucharski2016)). The `{ringbp}` model was initially developed
to support a paper written in early 2020 to assess the feasibility of
controlling COVID-19 ([Hellewell et al. 2020](#ref-Hellewell2020)).

`{ringbp}` is an R package that provides methods to simulate infectious
disease transmission in the presence of contact tracing. It was
initially developed to support a paper written in early 2020 to assess
the [feasibility of controlling
COVID-19](https://github.com/cmmid/ringbp). For more details on the
methods implemented here, see the associated
[paper](https://doi.org/10.1016/S2214-109X(20)30074-7).
See the [companion analysis code](https://github.com/cmmid/ringbp) to
reproduce Hellewell et al. ([2020](#ref-Hellewell2020)).

For more details on the methods implemented in the `{ringbp}` R package,
see the Hellewell et al. ([2020](#ref-Hellewell2020))
[paper](https://doi.org/10.1016/S2214-109X(20)30074-7), and the [package
documentation](https://epiforecasts.io/ringbp/articles/).

## Installation

The current development version of `{ringbp}` can be installed from
[GitHub](https://github.com/) using the `pak` package.
The package can be installed from CRAN using

``` r
install.packages("ringbp")
```

You can install the development version of `{ringbp}` from
[GitHub](https://github.com/) with:

``` r
# check whether {pak} is installed
if(!require("pak")) install.packages("pak")
pak::pak("epiforecasts/ringbp")
```

Alternatively, install pre-compiled binaries from [the epiforecasts
R-universe](https://epiforecasts.r-universe.dev/ringbp)

``` r
install.packages("ringbp", repos = c("https://epiforecasts.r-universe.dev", "https://cloud.r-project.org"))
```

## Quick start

The main functionality of the package is in the `scenario_sim()`
Expand Down Expand Up @@ -75,8 +89,8 @@ res <- scenario_sim(
## whether quarantine is in effect
interventions = intervention_opts(quarantine = FALSE),
sim = sim_opts(
## don't simulate beyond 350 days
cap_max_days = 350,
## don't simulate beyond 140 days
cap_max_days = 140,
## don't simulate beyond 4500 infections
cap_cases = 4500
)
Expand All @@ -89,7 +103,7 @@ res <- scenario_sim(
ggplot(
data = res, aes(x = week, y = cumulative, col = as.factor(sim))
) +
geom_line(show.legend = FALSE, alpha = 0.3) +
geom_line(show.legend = FALSE) +
scale_y_continuous(name = "Cumulative number of cases") +
theme_bw()
```
Expand All @@ -101,7 +115,7 @@ ggplot(
``` r
extinct_prob(res)
#> Calculating extinction using the extinction status from the simulation.
#> [1] 0.9
#> [1] 0.6
```

## Contribute
Expand Down Expand Up @@ -158,3 +172,30 @@ Please note that the `{ringbp}` project is released with a [Contributor
Code of
Conduct](https://github.com/epiforecasts/.github/blob/main/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.

## References

<div id="refs" class="references csl-bib-body hanging-indent"
entry-spacing="0">

<div id="ref-Hellewell2020" class="csl-entry">

Hellewell, Joel, Sam Abbott, Amy Gimma, Nikos I Bosse, Christopher I
Jarvis, Timothy W Russell, James D Munday, et al. 2020. “Feasibility of
Controlling COVID-19 Outbreaks by Isolation of Cases and Contacts.” *The
Lancet Global Health* 8 (4): e488–96.
<https://doi.org/10.1016/s2214-109x(20)30074-7>.

</div>

<div id="ref-Kucharski2016" class="csl-entry">

Kucharski, Adam J., Rosalind M. Eggo, Conall H. Watson, Anton Camacho,
Sebastian Funk, and W. John Edmunds. 2016. “Effectiveness of Ring
Vaccination as Control Strategy for Ebola Virus Disease.” *Emerging
Infectious Diseases* 22 (1): 105–8.
<https://doi.org/10.3201/eid2201.151410>.

</div>

</div>
7 changes: 4 additions & 3 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ template:

reference:
- title: Model
- subtitle: Run outbreak scenario (multiple outbreak simulations) under one set of parameters
contents:
- scenario_sim
- subtitle: Outbreak simulation model components
contents:
- starts_with("outbreak_")
- title: Helper functions
- subtitle: Probability distribution manipulation
contents:
- incubation_to_generation_time
- subtitle: Loop wrappers for scenario modelling
contents:
- scenario_sim
- subtitle: Model parameters and control options
contents:
- delay_opts
Expand Down
12 changes: 12 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Resubmission
This is a resubmission. In this version I have:

* Removed the single quotes around the reference in the DESCRIPTION.

* Updated COPYRIGHT HOLDER from 'epiforecasts' to 'ringbp authors'.

## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.
Loading
Loading