diff --git a/.Rbuildignore b/.Rbuildignore index 89aa541..045954b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,5 +12,5 @@ ^figure* ^docs* .*tar.gz$ - +^README.html$ ^\.github$ diff --git a/DESCRIPTION b/DESCRIPTION index 2d3616a..2671b10 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: projections Title: Project Future Case Incidence -Version: 0.6.0 +Version: 0.6.1 Authors@R: c(person(given = "Thibaut", family = "Jombart", @@ -46,7 +46,7 @@ Imports: incidence (>= 1.4.1), ggplot2, methods -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 Roxygen: list(markdown = TRUE) URL: https://www.repidemicsconsortium.org/projections/ BugReports: https://github.com/reconhub/projections/issues diff --git a/NEWS.md b/NEWS.md index c7e4536..88c626d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,12 @@ +# projections 0.6.1 + +## Fixes and improvements + +- fixed tests of dates due failing due to changes in `as.Date()` +- fixed example in the manpage of `summary.projection` + + + # projections 0.6.0 ## Fixes and improvements diff --git a/R/summary.R b/R/summary.R index 8e0f79e..a48aa87 100644 --- a/R/summary.R +++ b/R/summary.R @@ -26,6 +26,7 @@ #' #' @param ... only preesnt for compatibility with the generic #' +#' @examples #' if (require(incidence)) { #' i <- incidence::incidence(as.Date('2020-01-23')) #' si <- c(0.2, 0.5, 0.2, 0.1) diff --git a/man/summary.projections.Rd b/man/summary.projections.Rd index 2bef359..5dbd0e0 100644 --- a/man/summary.projections.Rd +++ b/man/summary.projections.Rd @@ -28,30 +28,31 @@ computed; ignored if \code{FALSE} or of length 0} \item{max}{a \code{logical} indicating of the maximum should be computed} -\item{...}{only preesnt for compatibility with the generic - -if (require(incidence)) { -i <- incidence::incidence(as.Date('2020-01-23')) -si <- c(0.2, 0.5, 0.2, 0.1) -R0 <- 2 - -p <- project(x = i, -si = si, -R = R0, -n_sim = 2, -R_fix_within = TRUE, -n_days = 10, -model = "poisson" -) -summary(p) - -}} +\item{...}{only preesnt for compatibility with the generic} } \description{ This method summarises predicted epidemic trajectories contained in a \code{projections} object by days, deriving the mean, standard deviation, and user-specified quantiles for each day. } +\examples{ +if (require(incidence)) { + i <- incidence::incidence(as.Date('2020-01-23')) + si <- c(0.2, 0.5, 0.2, 0.1) + R0 <- 2 + + p <- project(x = i, + si = si, + R = R0, + n_sim = 2, + R_fix_within = TRUE, + n_days = 10, + model = "poisson" + ) + summary(p) + +} +} \author{ Thibaut Jombart } diff --git a/tests/testthat/_snaps/plots/basic-example-plot.svg b/tests/testthat/_snaps/plots/basic-example-plot.svg index 600cf92..baa9fd8 100644 --- a/tests/testthat/_snaps/plots/basic-example-plot.svg +++ b/tests/testthat/_snaps/plots/basic-example-plot.svg @@ -72,19 +72,19 @@ Predicted incidence quantile - + - + - + - + - + - + - + 1% 5% diff --git a/tests/testthat/_snaps/plots/evd-proj-box-no-outliers.svg b/tests/testthat/_snaps/plots/evd-proj-box-no-outliers.svg index afb8987..2ac1f5f 100644 --- a/tests/testthat/_snaps/plots/evd-proj-box-no-outliers.svg +++ b/tests/testthat/_snaps/plots/evd-proj-box-no-outliers.svg @@ -406,19 +406,19 @@ Predicted incidence quantile - + - + - + - + - + - + - + 1% 5% diff --git a/tests/testthat/_snaps/plots/evd-proj-no-box-custom-lines.svg b/tests/testthat/_snaps/plots/evd-proj-no-box-custom-lines.svg index 755e147..8f80ccd 100644 --- a/tests/testthat/_snaps/plots/evd-proj-no-box-custom-lines.svg +++ b/tests/testthat/_snaps/plots/evd-proj-no-box-custom-lines.svg @@ -21,7 +21,7 @@ - + @@ -83,19 +83,19 @@ Predicted incidence quantile - + - + - + - + - + - + - + 1% 5% diff --git a/tests/testthat/_snaps/plots/evd-proj-no-ribbon.svg b/tests/testthat/_snaps/plots/evd-proj-no-ribbon.svg index 9a281f0..1e94472 100644 --- a/tests/testthat/_snaps/plots/evd-proj-no-ribbon.svg +++ b/tests/testthat/_snaps/plots/evd-proj-no-ribbon.svg @@ -21,7 +21,7 @@ - + @@ -80,19 +80,19 @@ Predicted incidence quantile - + - + - + - + - + - + - + 1% 5% diff --git a/tests/testthat/_snaps/plots/evd-proj-red-box.svg b/tests/testthat/_snaps/plots/evd-proj-red-box.svg index a8fee77..f0d4c0f 100644 --- a/tests/testthat/_snaps/plots/evd-proj-red-box.svg +++ b/tests/testthat/_snaps/plots/evd-proj-red-box.svg @@ -406,19 +406,19 @@ Predicted incidence quantile - + - + - + - + - + - + - + 1% 5% diff --git a/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence-and-custom.svg b/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence-and-custom.svg index 6adf373..fe1ae06 100644 --- a/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence-and-custom.svg +++ b/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence-and-custom.svg @@ -280,35 +280,35 @@ Daily incidence quantile - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + 0.1% 1% diff --git a/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence-no-box.svg b/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence-no-box.svg index 7d8ace8..00976db 100644 --- a/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence-no-box.svg +++ b/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence-no-box.svg @@ -796,19 +796,19 @@ Daily incidence quantile - + - + - + - + - + - + - + 1% 5% diff --git a/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence.svg b/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence.svg index aaee8a1..959f9af 100644 --- a/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence.svg +++ b/tests/testthat/_snaps/plots/evd-proj-with-incidence-incidence.svg @@ -21,7 +21,7 @@ - + @@ -473,19 +473,19 @@ Daily incidence quantile - + - + - + - + - + - + - + 1% 5% diff --git a/tests/testthat/_snaps/plots/evd-proj.svg b/tests/testthat/_snaps/plots/evd-proj.svg index 0a2f67f..1ddfd57 100644 --- a/tests/testthat/_snaps/plots/evd-proj.svg +++ b/tests/testthat/_snaps/plots/evd-proj.svg @@ -21,7 +21,7 @@ - + @@ -83,19 +83,19 @@ Predicted incidence quantile - + - + - + - + - + - + - + 1% 5% diff --git a/tests/testthat/test-project.R b/tests/testthat/test-project.R index 230b97d..c8deed4 100644 --- a/tests/testthat/test-project.R +++ b/tests/testthat/test-project.R @@ -12,7 +12,7 @@ test_that("Projections can be performed for a single day", { model = "poisson" ) - expect_identical(get_dates(p), as.Date("2020-01-24")) + expect_equal(get_dates(p), as.Date("2020-01-24")) }) @@ -33,7 +33,7 @@ test_that("Projections can be performed for a single day", { model = "poisson" ) - expect_identical(get_dates(p), as.Date("2020-01-24") + 0:1) + expect_equal(get_dates(p), as.Date("2020-01-24") + 0:1) expect_identical(ncol(p), 1L) }) @@ -55,7 +55,7 @@ test_that("Projections can be performed for a single day and single simulation", model = "poisson" ) - expect_identical(get_dates(p), as.Date("2020-01-24")) + expect_equal(get_dates(p), as.Date("2020-01-24")) expect_identical(ncol(p), 1L) })