Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Nov 16, 2022
1 parent aaf2d1e commit 0ede0b4
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion R/create.R
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ create_initial_conditions <- function(data) {
))
}
if (data$week_effect > 0) {
out$day_of_week_simplex = rep(1 / data$week_effect, data$week_effect)
out$day_of_week_simplex = array(rep(1 / data$week_effect, data$week_effect))
}
return(out)
}
Expand Down
16 changes: 8 additions & 8 deletions R/report.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#'
#' # run model
#' out <- estimate_infections(cases,
#' samples = 100,
#' stan = stan_opts(samples = 100),
#' generation_time = generation_time,
#' delays = delay_opts(incubation_period, reporting_delay),
#' rt = NULL
Expand All @@ -55,13 +55,13 @@ report_cases <- function(case_estimates,

# define delay distributions
delay_defs <- purrr::map(
delays,
seq_along(delays$delays),
~ EpiNow2::lognorm_dist_def(
mean = .$mean,
mean_sd = .$mean_sd,
sd = .$sd,
sd_sd = .$sd_sd,
max_value = .$max,
mean = delays$delay_mean_mean[.x],
mean_sd = delays$delay_mean_sd[.x],
sd = delays$delay_sd_mean[.x],
sd_sd = delays$delay_sd_sd[.x],
max_value = delays$delay_max[.x],
samples = samples
)
)
Expand Down Expand Up @@ -248,7 +248,7 @@ report_summary <- function(summarised_estimates,
#'
#' # run model
#' out <- estimate_infections(cases,
#' samples = 100,
#' stan = stan_opts(samples = 100),
#' generation_time = generation_time,
#' delays = delay_opts(incubation_period, reporting_delay),
#' rt = NULL
Expand Down
2 changes: 1 addition & 1 deletion R/simulate_infections.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#' )
#'
#' # update Rt trajectory and simulate new infections using it
#' R <- c(rep(NA_real_, 40), rep(0.5, 10), rep(0.8, 7))
#' R <- c(rep(NA_real_, 26), rep(0.5, 10), rep(0.8, 7))
#' sims <- simulate_infections(est, R)
#' plot(sims)
#'
Expand Down
4 changes: 2 additions & 2 deletions R/summarise.R
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ summarise_key_measures <- function(regional_results = NULL,
#' # example delays
#' generation_time <- get_generation_time(disease = "SARS-CoV-2", source = "ganyani")
#' incubation_period <- get_incubation_period(disease = "SARS-CoV-2", source = "lauer")
#' reporting_delay <- example_delay(rlnorm(100, log(6), 1), max_value = 15)
#' reporting_delay <- estimate_delay(rlnorm(100, log(6), 1), max_value = 15)
#'
#' cases <- example_confirmed[1:30]
#' cases <- data.table::rbindlist(list(
Expand All @@ -484,7 +484,7 @@ summarise_key_measures <- function(regional_results = NULL,
#' reported_cases = cases,
#' generation_time = generation_time,
#' delays = delay_opts(incubation_period, reporting_delay),
#' samples = 100, stan_args = list(warmup = 100),
#' stan = stan_opts(samples = 100, warmup = 100),
#' output = c("region", "timing")
#' )
#'
Expand Down
4 changes: 2 additions & 2 deletions man/regional_runtimes.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/report_cases.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/report_plots.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/simulate_infections.Rd

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

0 comments on commit 0ede0b4

Please sign in to comment.