regional_rt_pipeline.Rd
Runs a pipeline by region.
regional_rt_pipeline( cases = NULL, linelist = NULL, delay_defs = NULL, incubation_defs = NULL, target_folder = "results", target_date = NULL, merge_onsets = FALSE, case_limit = 40, onset_modifier = NULL, dt_threads = 1, verbose = FALSE, ... )
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 |
if (FALSE) { ## 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) }