Learn R Programming

EpiNow2 (version 1.3.2)

regional_summary: Regional Summary Output

Description

Used to produce summary output either internally in regional_epinow or externally.

Usage

regional_summary(
  regional_output = NULL,
  reported_cases,
  results_dir = NULL,
  summary_dir = NULL,
  target_date = NULL,
  region_scale = "Region",
  all_regions = TRUE,
  return_output = FALSE,
  max_plot = 10
)

Arguments

regional_output

A list of output as produced by regional_epinow and stored in the regional list.

reported_cases

A data frame of confirmed cases (confirm) by date (date), and region (region).

results_dir

An optional character string indicating the location of the results directory to extract results from.

summary_dir

A character string giving the directory in which to store summary of results.

target_date

A character string giving the target date for which to extract results (in the format "yyyy-mm-dd"). Defaults to latest available estimates.

region_scale

A character string indicating the name to give the regions being summarised.

all_regions

Logical, defaults to TRUE. Should summary plots for all regions be returned rather than just regions of interest.

return_output

Logical, defaults to FALSE. Should output be returned, this automatically updates to TRUE if no directory for saving is specified.

max_plot

Numeric, defaults to 10. A multiplicative upper bound on the number of cases shown on the plot. Based on the maximum number of reported cases.

Value

A list of summary measures and plots

See Also

regional_epinow

Examples

Run this code
# NOT RUN {
# 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 <- estimate_delay(rlnorm(100, log(6), 1), max_value = 30)
                        
# example case vector from EpiSoon
cases <- example_confirmed[1:30]
cases <- data.table::rbindlist(list(
  data.table::copy(cases)[, region := "testland"],
  cases[, region := "realland"]))
  
# run basic nowcasting pipeline
out <- regional_epinow(reported_cases = cases,
                       generation_time = generation_time,
                       delays = delay_opts(incubation_period, reporting_delay),
                       output = "region",
                       rt = NULL)

regional_summary(regional_output = out$regional,
                 reported_cases = cases)
# }

Run the code above in your browser using DataLab