enw_add_max_reported | R Documentation |
reference_date
This is a helper function which adds the maximum (in the sense of latest observed) number of reported cases for each reference_date and computes the proportion of already reported cases for each combination of reference_date and report_date.
enw_add_max_reported(obs, copy = TRUE)
obs |
A |
copy |
Should |
A data.table with new columns max_confirm
and cum_prop_reported
.
max_confirm
is the maximum number of cases reported for a certain
reference_date. cum_prop_reported
is the proportion of cases for a certain
reference_date that are reported until a given report_day, relative to all
cases so far observed for this reference_date.
Preprocessing functions
enw_add_delay()
,
enw_add_metaobs_features()
,
enw_assign_group()
,
enw_complete_dates()
,
enw_construct_data()
,
enw_extend_date()
,
enw_filter_delay()
,
enw_filter_reference_dates()
,
enw_filter_report_dates()
,
enw_flag_observed_observations()
,
enw_impute_na_observations()
,
enw_latest_data()
,
enw_metadata()
,
enw_metadata_delay()
,
enw_missing_reference()
,
enw_preprocess_data()
,
enw_reporting_triangle()
,
enw_reporting_triangle_to_long()
obs <- data.frame(report_date = as.Date("2021-01-01") + 0:2)
obs$reference_date <- as.Date("2021-01-01")
obs$confirm <- 1:3
enw_add_max_reported(obs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.