Skip to content

fix errors introduced in #378 #380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
forecast correct part of cases in test/example
  • Loading branch information
sbfnk committed Apr 27, 2023
commit 35fd1d77caf955bcdf46323fa0790644875aec47
6 changes: 4 additions & 2 deletions R/estimate_secondary.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
#' plot(inc, primary = TRUE)
#'
#' # forecast future secondary cases from primary
#' inc_preds <- forecast_secondary(inc, cases[seq_len(.N)][, value := primary])
#' inc_preds <- forecast_secondary(
#' inc, cases[seq(61, .N)][, value := primary]
#' )
#' plot(inc_preds, new_obs = cases, from = "2020-05-01")
#'
#' #### Prevalence data example ####
Expand Down Expand Up @@ -116,7 +118,7 @@
#'
#' # forecast future secondary cases from primary
#' prev_preds <- forecast_secondary(
#' prev, cases[10seq_len(.N)][, value := primary]
#' prev, cases[seq(101, .N)][, value := primary]
#' )
#' plot(prev_preds, new_obs = cases, from = "2020-06-01")
#'
Expand Down
6 changes: 4 additions & 2 deletions man/estimate_secondary.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-estimate_secondary.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ test_that("estimate_secondary can recover simulated parameters", {

test_that("forecast_secondary can return values from simulated data and plot
them", {
inc_preds <- forecast_secondary(inc, cases[seq_len(.N)][, value := primary])
inc_preds <- forecast_secondary(inc, cases[seq(61, .N)][, value := primary])
expect_equal(names(inc_preds), c("samples", "forecast", "predictions"))
# validation plot of observations vs estimates
expect_error(plot(inc_preds, new_obs = cases, from = "2020-05-01"), NA)
Expand Down