Description Usage Arguments Examples
View source: R/regional_rt_pipeline.R
Runs a pipeline by region.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
cases |
A dataframe of cases ( |
linelist |
A dataframe of of cases (by row) containing the following variables:
|
delay_defs |
A data.table that defines the delay distributions (model, parameters and maximum delay for each model).
See |
incubation_defs |
A data.table that defines the incubation distributions (model, parameters and maximum delay for each model).
See |
target_folder |
Character string indicating the folder into which to save results. Also used to extract previously generated results. |
target_date |
Character string, in the form "2020-01-01". Date to cast. |
merge_onsets |
Logical defaults to |
case_limit |
Numeric, the minimum number of cases in a region required for that region to be evaluated. Defaults to 10.
set to |
onset_modifier |
data.frame containing a |
dt_threads |
Numeric, the number of data.table threads to use. Set internally to avoid issue when running in parallel. Defaults to 1 thread. |
verbose |
Logical, defaults to |
... |
Pass additional arguments to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
## Save everything to a temporary directory
## Change this to inspect locally
target_dir <- tempdir()
## Construct example distributions
## reporting delay dist
delay_dist <- suppressWarnings(
EpiNow::get_dist_def(rexp(25, 1/10),
samples = 5, bootstraps = 1))
## Uses example case vector from EpiSoon
cases <- data.table::setDT(EpiSoon::example_obs_cases)
cases <- cases[, `:=`(confirm = as.integer(cases), import_status = "local")][,
cases := NULL]
cases <- data.table::rbindlist(list(
data.table::copy(cases)[, region := "testland"],
cases[, region := "realland"]))
## Run basic nowcasting pipeline
regional_rt_pipeline(cases = cases,
delay_defs = delay_dist,
target_folder = target_dir)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.