Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions R/offspring_distributions.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Density of the poisson-lognormal compound distribution
#' Density of the Poisson-lognormal compound distribution
#'
#' @details
#' The function is vectorised so a vector of quantiles can be input and the
Expand All @@ -9,7 +9,7 @@
#' @param sdlog A `number` for the standard deviation of the distribution on
#' the log scale.
#'
#' @return A `numeric` vector of the density of the poisson-lognormal
#' @return A `numeric` vector of the density of the Poisson-lognormal
#' distribution.
#' @export
#'
Expand All @@ -34,7 +34,7 @@ dpoislnorm <- Vectorize(function(x, meanlog, sdlog) {
})


#' Cumulative distribution function of the poisson-lognormal compound
#' Cumulative distribution function of the Poisson-lognormal compound
#' distribution
#'
#' @details
Expand Down Expand Up @@ -63,7 +63,7 @@ ppoislnorm <- Vectorize(function(q, meanlog, sdlog) {
sum(dpoislnorm(x = seq(0, q, by = 1), meanlog = meanlog, sdlog = sdlog))
})

#' Density of the poisson-Weibull compound distribution
#' Density of the Poisson-Weibull compound distribution
#'
#' @details
#' The function is vectorised so a vector of quantiles can be input and the
Expand All @@ -73,7 +73,7 @@ ppoislnorm <- Vectorize(function(q, meanlog, sdlog) {
#' @param shape A `number` for the shape parameter of the distribution.
#' @param scale A `number` for the scale parameter of the distribution.
#'
#' @return A `numeric` vector of the density of the poisson-Weibull
#' @return A `numeric` vector of the density of the Poisson-Weibull
#' distribution.
#' @export
#'
Expand All @@ -100,7 +100,7 @@ dpoisweibull <- Vectorize(function(x, shape, scale) {
out
})

#' Cumulative distribution function of the poisson-Weibull compound
#' Cumulative distribution function of the Poisson-Weibull compound
#' distribution
#'
#' @details
Expand Down
2 changes: 1 addition & 1 deletion R/proportion_transmission.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#' parameter \eqn{k}, which encodes all variation in infectious histories of
#' individuals, including properties of the host and pathogen and environmental
#' circumstances." The value of \eqn{k} corresponds to the shape parameters of
#' the gamma distribution which encodes the variation in the gamma-poisson
#' the gamma distribution which encodes the variation in the gamma-Poisson
#' mixture a.k.a. the negative binomial.
#'
#' For `method = t_20`, we define the upper proportion of infectiousness,
Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ dynamics do not change).

## Package vignettes

More details on how to use `{superspreading}` can be found in the [online documentation as package vignettes](https://epiverse-trace.github.io/superspreading/), under "Articles".
More details on how to use `{superspreading}` can be found in the [online documentation as package vignettes](https://epiverse-trace.github.io/superspreading/), under [Articles](https://epiverse-trace.github.io/superspreading/articles/).

### Visualisation and plotting functionality

`{superspreading}` does not provide plotting functions, instead we provide example code chunks in the package's vignettes that can be used as a templates upon which data visualisations can be modified. We recommend users copy and edit the examples for their own purposes. (This is permitted under the package's MIT license). By default code chunks for plotting are folded, in order to unfold them and see the code simply click the code button at the top left of the plot.
`{superspreading}` does not provide plotting functions, instead we provide example code chunks in the package's vignettes that can be used as a templates upon which data visualisations can be modified. We recommend users copy and edit the examples for their own purposes. (This is permitted under the package's MIT license).

## Help

Expand All @@ -161,7 +161,7 @@ Contributions to `{superspreading}` are welcomed. Please follow the [package con

## Code of Conduct

Please note that the {superspreading} project is released with a
Please note that the `{superspreading}` project is released with a
[Contributor Code of Conduct](https://github.com/epiverse-trace/.github/blob/main/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.

Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,15 @@ inevitably cease assuming transmission dynamics do not change).
More details on how to use `{superspreading}` can be found in the
[online documentation as package
vignettes](https://epiverse-trace.github.io/superspreading/), under
Articles.
[Articles](https://epiverse-trace.github.io/superspreading/articles/).

### Visualisation and plotting functionality

`{superspreading}` does not provide plotting functions, instead we
provide example code chunks in the package’s vignettes that can be used
as a templates upon which data visualisations can be modified. We
recommend users copy and edit the examples for their own purposes. (This
is permitted under the package’s MIT license). By default code chunks
for plotting are folded, in order to unfold them and see the code simply
click the code button at the top left of the plot.
is permitted under the package’s MIT license).

## Help

Expand All @@ -208,7 +206,7 @@ guide](https://github.com/epiverse-trace/.github/blob/main/CONTRIBUTING.md).

## Code of Conduct

Please note that the {superspreading} project is released with a
Please note that the `{superspreading}` project is released with a
[Contributor Code of
Conduct](https://github.com/epiverse-trace/.github/blob/main/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.
Expand Down
2 changes: 2 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Fitdistrplus
frac
Getz
ggplot
ggtext
Gostic
Hanne
Heleze
Expand Down Expand Up @@ -70,6 +71,7 @@ MDN
MERS
Meuwissen
mpox
nCoV
N’Faly
Natsal
neq
Expand Down
6 changes: 3 additions & 3 deletions man/dpoislnorm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/dpoisweibull.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/ppoislnorm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/ppoisweibull.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/proportion_transmission.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions vignettes/design-principles.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This document is primarily intended to be read by those interested in understand

## Scope

The {superspreading} package aims to provide a range of summary metrics to characterise individual-level variation in disease transmission and its impact on the growth or decline of an epidemic. These include calculating the probability an outbreak becomes an epidemic (`probability_epidemic()`), or conversely goes extinct (`probability_extinct()`), the probability an outbreak can be contained (`probability_contain()`), the proportion of cases in cluster of a given size (`proportion_cluster_size()`), and the proportion of cases that cause a proportion of transmission (`proportion_transmission()`).
The {superspreading} package aims to provide a range of summary metrics to characterise individual-level variation in disease transmission and its impact on the growth or decline of an epidemic. These include calculating the probability an outbreak becomes an epidemic (`probability_epidemic()`), or conversely goes extinct (`probability_extinct()`), the probability an outbreak can be contained (`probability_contain()`), the probability of a pathogen evolving and emerging, the proportion of cases in cluster of a given size (`proportion_cluster_size()`), and the proportion of cases that cause a proportion of transmission (`proportion_transmission()`).

The other aspect of the package is to provide probability density functions and cumulative distribution functions to compute the likelihood for distribution models to estimate heterogeneity in individual-level disease transmission that are not available in R (i.e. base R). At present we include two models: Poisson-lognormal (`dpoislnorm()` & `ppoislnorm()`) and Poisson-Weibull (`dpoisweibull()` & `ppoisweibull()`) distributions.

Expand All @@ -38,7 +38,7 @@ The distribution functions return a vector of `numeric`s of equal length to the

- The distribution functions are vectorised (i.e. wrapped in `Vectorize()`). This enables them to be used identically to base R distribution functions.

- Native interoperability with `<epiparameter>` objects, from the {epiparameter} package is enabled for `probability_*()` and `proportion_*()` via the `offspring_dist` argument. This allows user to pass in a single object and the parameters required by the {superspreading} function will be extracted, if these are not available within the `<epiparameter>` object the function returns an informative error. The `offspring_dist` argument is after `...` to ensure users specify the argument in full and not accidentally provide data to this argument.
- Native interoperability with `<epiparameter>` objects, from the {epiparameter} package is enabled for `probability_*()` and `proportion_*()` via the `offspring_dist` argument. This allows user to pass in a single object and the parameters required by the {superspreading} function will be extracted, if these are not available within the `<epiparameter>` object the function returns an informative error. The `offspring_dist` argument is after `...` to ensure users specify the argument in full and not accidentally provide data to this argument. The exception is `probability_emergence()` which does not have an `offspring_dist` argument and thus no interoperability with {epiparameter} due to the function using two reproduction numbers so handling multiple `<epiparameter>` objects was judged to add too much complexity for the benefit.

- Internal functions have a dot (`.`) prefix, exported functions do not.

Expand All @@ -50,10 +50,11 @@ The aim is to restrict the number of dependencies to a minimal required set for

* {stats}
* [{checkmate}](https://CRAN.R-project.org/package=checkmate)
* [{rlang}](https://CRAN.R-project.org/package=rlang)

{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.
{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. {rlang} is used to accept [dynamic dots](https://rlang.r-lib.org/reference/dyn-dots.html) in various {superspreading} functions.

Suggested dependencies (not including package documentation ({knitr}, {rmarkdown}), testing ({spelling} and {testthat}), and plotting ({ggplot2})) are: [{epiparameter}](https://github.com/epiverse-trace/epiparameter), used to easily access epidemiological parameters from the package's library, and [{fitdistrplus}](https://CRAN.R-project.org/package=fitdistrplus), used for model fitting methods.
Suggested dependencies are used for package documentation, including building vignettes ([{knitr}]( https://CRAN.R-project.org/package=knitr), [{rmarkdown}](https://CRAN.R-project.org/package=rmarkdown)), data wrangling ([{dplyr}](https://CRAN.R-project.org/package=dplyr), [{purrr}](https://CRAN.R-project.org/package=purrr)), plotting ([{ggplot2}](https://CRAN.R-project.org/package=ggplot2), [{scales}](https://CRAN.R-project.org/package=scales), [{ggtext}](https://CRAN.R-project.org/package=ggtext)), loading epidemiological parameters from [{epiparameter}](https://CRAN.R-project.org/package=epiparameter), and model fitting with [{fitdistrplus}](https://CRAN.R-project.org/package=fitdistrplus). There are also suggested dependencies for testing and spell checking ([{testthat}](https://CRAN.R-project.org/package=testthat), [{spelling}](https://CRAN.R-project.org/package=spelling)).

## Contribute

Expand Down
Loading
Loading