Description Usage Arguments Value Examples
Report case counts by date of report
1 2 3 4 5 6 7 8  | report_cases(
  nowcast,
  case_forecast = NULL,
  delay_defs,
  incubation_defs,
  type = "median",
  reporting_effect
)
 | 
nowcast | 
 A dataframe as produced by   | 
case_forecast | 
 A data.table of case forecasts as produced by   | 
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   | 
type | 
 Character string indicating the method to use to transfrom counts. Supports either "sample" which approximates sampling or "median" would shift by the median of the distribution.  | 
reporting_effect | 
 A   | 
A data.table containing the following variables sample, date and cases
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 27 28 29 30 31 32  | ## Define example cases
cases <- data.table::as.data.table(EpiSoon::example_obs_cases) 
cases <- cases[, `:=`(confirm = as.integer(cases), import_status = "local")]
## Define a single report delay distribution
delay_defs <- EpiNow::lognorm_dist_def(mean = 5, 
                                       mean_sd = 1,
                                       sd = 3,
                                       sd_sd = 1,
                                       max_value = 30,
                                       samples = 2)
                                       
## Define a single incubation period
incubation_defs <- EpiNow::lognorm_dist_def(mean = EpiNow::covid_incubation_period[1, ]$mean,
                                            mean_sd = EpiNow::covid_incubation_period[1, ]$mean_sd,
                                            sd = EpiNow::covid_incubation_period[1, ]$sd,
                                            sd_sd = EpiNow::covid_incubation_period[1, ]$sd_sd,
                                            max_value = 30, samples = 2)
                                           
## Perform a nowcast
nowcast <- nowcast_pipeline(reported_cases = cases, 
                            target_date = max(cases$date),
                            delay_defs = delay_defs,
                            incubation_defs = incubation_defs)
                            
                     
reported_cases <- report_cases(nowcast, delay_defs = delay_defs,
                               incubation_defs = incubation_defs)
                               
print(reported_cases)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.