Skip to content

Commit

Permalink
Merge pull request #84 from annecori/windows_check_fix
Browse files Browse the repository at this point in the history
Windows check fix
  • Loading branch information
annecori authored Jul 12, 2019
2 parents 39b3440 + 3de2e96 commit 37308ed
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ fitRotavirus.R
^\.Rproj\.user$
^\.travis\.yml$
^codecov\.yml$
^CRAN-RELEASE$
^cran-comments\.md$
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: EpiEstim
Version: 2.2-0
Title: Estimate Time Varying Reproduction Numbers From Epidemic Curves
Version: 2.2-1
Title: Estimate Time Varying Reproduction Numbers from Epidemic Curves
Authors@R: c(person("Anne", "Cori", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-8443-9162")),
person("Simon", "Cauchemez", role = "ctb"),
person("Neil M.", "Ferguson", role = "ctb", comment = c(ORCID = "0000-0002-1154-8093")),
Expand All @@ -17,7 +17,7 @@ Authors@R: c(person("Anne", "Cori", email = "[email protected]", role = c("a
person("Rolina", "van Gaalen", role = "ctb")
)
Maintainer: Anne Cori <[email protected]>
Description: This package provides tools to quantify transmissibility throughout
Description: Tools to quantify transmissibility throughout
an epidemic from the analysis of time series of incidence as described in
Cori et al. (2013) <doi:10.1093/aje/kwt133> and Wallinga and Teunis (2004)
<doi:10.1093/aje/kwh255>.
Expand Down
17 changes: 17 additions & 0 deletions EpiEstim.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
2 changes: 1 addition & 1 deletion R/check_cdt_samples_convergence.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @return TRUE if the Gelman Rubin test for convergence was successful, FALSE
#' otherwise
#' @details{
#' This function splits an MCMC chain in two halfs and uses the Gelman-Rubin
#' This function splits an MCMC chain in two halves and uses the Gelman-Rubin
#' algorithm to assess convergence of the chain by comparing its two halves.
#' }
#' @seealso \code{\link{estimate_R}}
Expand Down
6 changes: 5 additions & 1 deletion R/compatibility.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ DiscrSI <- function(k, mu, sigma) {

#' @export
OverallInfectivity <- function(I, SI.Distr) {
.Deprecated("overall_infectivity")
# We will eventually properly deprecate this, but it is being used in other
# packages at the moment, so soft deprecate for now.
if (interactive()) {
.Deprecated("overall_infectivity")
}
overall_infectivity(incid = I, si_distr = SI.Distr)
}

Expand Down
8 changes: 4 additions & 4 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' This data set gives:
#'
#' 1. the daily incidence of self-reported and laboratory-confirmed cases of
#' influenza amongst children in a school in New York city during the 2009
#' influenza among children in a school in New York city during the 2009
#' H1N1 influenza pandemic (see source and references),
#' 2. interval-censored serial interval data from the 2009 outbreak of H1N1
#' influenza in a New York city school (see references).
Expand Down Expand Up @@ -123,7 +123,7 @@ NULL
#'
#' 1. the daily incidence of onset of acute respiratory illness
#' (ARI, defined as at least two symptoms among fever, cough, sore throat,
#' and runny nose) amongst children in a school in Pennsylvania during the
#' and runny nose) among children in a school in Pennsylvania during the
#' 2009 H1N1 influenza pandemic (see source and references),
#' 2. the discrete daily distribution of the serial interval for influenza,
#' assuming a shifted Gamma distribution with mean 2.6 days, standard
Expand Down Expand Up @@ -361,7 +361,7 @@ NULL
#' observation corresponds to a pair of infector/infected individuals. EL
#' and ER columns contain the lower an upper bounds of the dates of
#' symptoms onset in the infectors. SL and SR columns contain the lower an
#' upper bounds of the dates of symptoms onset in the infected indiviuals.
#' upper bounds of the dates of symptoms onset in the infected individuals.
#' The type column has entries 0, 1, or 2, corresponding to doubly
#' interval-censored, single interval-censored or exact observations,
#' respectively, see Reich et al. Statist. Med. 2009
Expand Down Expand Up @@ -401,7 +401,7 @@ NULL
#' 1. the daily incidence of onset of symptoms of laboratory confirmed human
#' infections with MERS-CoV in Saudi Arabia between the beginning of July
#' 2014 and the end of December 2015, and
#' 2. estimates of the mean and standrad deviation of the serial interval for
#' 2. estimates of the mean and standard deviation of the serial interval for
#' MERS.
#'
#' @name mers_2014_15
Expand Down
2 changes: 1 addition & 1 deletion R/discr_si.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' \code{discr_si} computes the discrete distribution of the serial interval,
#' assuming that the serial interval is shifted Gamma distributed, with shift 1.
#'
#' @param k Positive integer, or vector of positive ingerers for which the
#' @param k Positive integer, or vector of positive interers for which the
#' discrete distribution is desired.
#' @param mu A positive real giving the mean of the Gamma distribution.
#' @param sigma A non-negative real giving the standard deviation of the Gamma
Expand Down
2 changes: 1 addition & 1 deletion R/estimate_r.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
#' alternative to the previous method, where the MCMC estimation of the serial
#' interval distribution could be run once, and the same estimated SI
#' distribution then used in estimate_R in different contexts, e.g. with
#' different time windows, hence avoiding to rerun the MCMC everytime
#' different time windows, hence avoiding to rerun the MCMC every time
#' estimate_R is called.}
#' }
#'
Expand Down
8 changes: 4 additions & 4 deletions R/init_mcmc_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
#' \code{estimate_R}
#'
#' \code{init_mcmc_params} Finds values of the serial interval distribution
#' parameters, used to initalise the MCMC estimation of the serial interval
#' parameters, used to initialise the MCMC estimation of the serial interval
#' distribution. Initial values are computed based on the observed mean and
#' standard deviation of the sample from which the parameters are to be
#' estiamted.
#' estimated.
#'
#' @param si_data the data on dates of symptoms of pairs of infector/infected
#' individuals to be used to estimate the serial interval distribution. This
#' should be a dataframe with 5 columns: \itemize{ \item{EL: the lower bound
#' of the symptom onset date of the infector (given as an integer)} \item{ER:
#' the upper bound of the symptom onset date of the infector (given as an
#' integer). Should be such that ER>=EL} \item{SL: the lower bound of the
#' symptom onset date of the infected indivdiual (given as an integer)}
#' symptom onset date of the infected individual (given as an integer)}
#' \item{SR: the upper bound of the symptom onset date of the infected
#' indivdiual (given as an integer). Should be such that SR>=SL} \item{type
#' individual (given as an integer). Should be such that SR>=SL} \item{type
#' (optional): can have entries 0, 1, or 2, corresponding to doubly
#' interval-censored, single interval-censored or exact observations,
#' respectively, see Reich et al. Statist. Med. 2009. If not specified, this
Expand Down
14 changes: 7 additions & 7 deletions R/make_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' items as input, set defaults where arguments are
#' missing, and return a list of settings.
#'
#' @param ... Acceptables arguments for ... are:
#' @param ... Acceptable arguments for ... are:
#'
#' \describe{
#'
Expand All @@ -31,7 +31,7 @@
#' serial interval (method "uncertain_si", see details).}
#'
#' \item{std_si}{For method "parametric_si" and "uncertain_si" ; non negative
#' real giving the stadard deviation of the serial interval
#' real giving the standard deviation of the serial interval
#' (method "parametric_si") or the average standard deviation of the serial
#' interval (method "uncertain_si", see details).}
#'
Expand Down Expand Up @@ -165,7 +165,7 @@
#' symmetric around the mean.
#' For each pair \eqn{(\mu^{(k)},\sigma^{(k)})}, we then draw a sample of size
#' \code{n2} in the posterior distribution of the reproduction number over each
#' time window, conditionnally on this serial interval distribution.
#' time window, conditionally on this serial interval distribution.
#' After pooling, a sample of size \eqn{\code{n1}\times\code{n2}} of the joint
#' posterior distribution of the reproduction number over each time window is
#' obtained.
Expand All @@ -191,17 +191,17 @@
#' \item{ER: the upper bound of the symptom onset date of the infector (given as
#' an integer). Should be such that ER>=EL}
#' \item{SL: the lower bound of the symptom onset date of the infected
#' indivdiual (given as an integer)}
#' individual (given as an integer)}
#' \item{SR: the upper bound of the symptom onset date of the infected
#' indivdiual (given as an integer). Should be such that SR>=SL}
#' individual (given as an integer). Should be such that SR>=SL}
#' \item{type (optional): can have entries 0, 1, or 2, corresponding to doubly
#' interval-censored, single interval-censored or exact observations,
#' respectively, see Reich et al. Statist. Med. 2009. If not specified, this
#' will be automatically computed from the dates}
#' }
#' Assuming a given parametric distribution for the serial interval distribution
#' (specified in si_parametric_distr),
#' the posterior distribution of the serial interval is estimated directly fom
#' the posterior distribution of the serial interval is estimated directly from
#' these data using MCMC methods implemented in the package
#' \code{coarsedatatools}.
#' The argument \code{mcmc_control} is a list of characteristics which control
Expand All @@ -214,7 +214,7 @@
#' For each element in the posterior sample of serial interval distribution,
#' we then draw a sample of size \code{n2} in the posterior distribution of the
#' reproduction number over each time window,
#' conditionnally on this serial interval distribution.
#' conditionally on this serial interval distribution.
#' After pooling, a sample of size \eqn{\code{n1}\times\code{n2}} of the joint
#' posterior distribution of
#' the reproduction number over each time window is obtained.
Expand Down
4 changes: 2 additions & 2 deletions R/make_mcmc_control.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#' \item{ER: the upper bound of the symptom onset date of the infector (given as
#' an integer). Should be such that ER>=EL}
#' \item{SL: the lower bound of the symptom onset date of the infected
#' indivdiual (given as an integer)}
#' individual (given as an integer)}
#' \item{SR: the upper bound of the symptom onset date of the infected
#' indivdiual (given as an integer). Should be such that SR>=SL}
#' individual (given as an integer). Should be such that SR>=SL}
#' \item{type (optional): can have entries 0, 1, or 2, corresponding to doubly
#' interval-censored, single interval-censored or exact observations,
#' respectively, see Reich et al. Statist. Med. 2009. If not specified, this
Expand Down
12 changes: 6 additions & 6 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#' series plot, to add the incidence of imported cases.
#'
#' @param options_I For what = "incid" or "all". A list of graphical options:
#' \describe{ \item{col}{A colour or vector of colours used for plotting
#' incid. By default uses the default R colours.} \item{transp}{A numeric
#' \describe{ \item{col}{A color or vector of colors used for plotting
#' incid. By default uses the default R colors.} \item{transp}{A numeric
#' value between 0 and 1 used to monitor transparency of the bars
#' plotted. Defaults to 0.7.} \item{xlim}{A parameter similar to that in
#' \code{par}, to monitor the limits of the horizontal axis} \item{ylim}{A
Expand All @@ -33,8 +33,8 @@
#' incidence plot}}
#'
#' @param options_R For what = "R" or "all". A list of graphical options:
#' \describe{ \item{col}{A colour or vector of colours used for plotting R. By
#' default uses the default R colours.} \item{transp}{A numeric value between
#' \describe{ \item{col}{A color or vector of colors used for plotting R. By
#' default uses the default R colors.} \item{transp}{A numeric value between
#' 0 and 1 used to monitor transparency of the 95\%CrI. Defaults to 0.2.}
#' \item{xlim}{A parameter similar to that in \code{par}, to monitor the
#' limits of the horizontal axis} \item{ylim}{A parameter similar to that in
Expand All @@ -45,8 +45,8 @@
#' \describe{ \item{prob_min}{A numeric value between 0 and 1. The SI
#' distributions explored are only shown from time 0 up to the time t so that
#' each distribution explored has probability < \code{prob_min} to be on any
#' time step after t. Defaults to 0.001.} \item{col}{A colour or vector of
#' colours used for plotting the SI. Defaults to black.} \item{transp}{A
#' time step after t. Defaults to 0.001.} \item{col}{A color or vector of
#' colors used for plotting the SI. Defaults to black.} \item{transp}{A
#' numeric value between 0 and 1 used to monitor transparency of the
#' lines. Defaults to 0.25} \item{xlim}{A parameter similar to that in
#' \code{par}, to monitor the limits of the horizontal axis} \item{ylim}{A
Expand Down
2 changes: 1 addition & 1 deletion R/wallinga_teunis.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' \code{t_start[i]<=t_end[i]}.} \item{method: One of "non_parametric_si" or
#' "parametric_si" (see details).} \item{mean_si: For method "parametric_si" ;
#' positive real giving the mean serial interval.} \item{std_si: For method
#' "parametric_si" ; non negative real giving the stadard deviation of the
#' "parametric_si" ; non negative real giving the standard deviation of the
#' serial interval.} \item{si_distr: For method "non_parametric_si" ; vector
#' of probabilities giving the discrete distribution of the serial interval,
#' starting with \code{si_distr[1]} (probability that the serial interval is
Expand Down
2 changes: 0 additions & 2 deletions TITLE

This file was deleted.

4 changes: 2 additions & 2 deletions vignettes/demo.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ number R. For this, we need to specify i) the time window(s) over which to
estimate R and ii) information on the distribution of the
serial interval.

For i), the default behaviour is to estimate R over weekly sliding windows.
For i), the default behavior is to estimate R over weekly sliding windows.
This can be changed through the `config$t_start` and `config$t_end` arguments
(see below, "Changing the time windows for estimation").
For ii), there are several options, specified in the `method` argument.
Expand Down Expand Up @@ -337,7 +337,7 @@ indicating the dates and the number of incident cases for each date.
`estimate_R` accepts a range of formats for its `incid` argument.

This can be a table, as we've seen. In that case there needs to be a column
called `I` containing the numebr of incident cases. If a column `dates` is
called `I` containing the number of incident cases. If a column `dates` is
present it is used in the x-axes when producing plots:

```{r incid_table}
Expand Down

0 comments on commit 37308ed

Please sign in to comment.