enw_add_delay | R Documentation |
This helper function takes a data.frame
or data.table
of
observations and adds the delay (numeric, in days) between reference_date
and report_date
for each observation.
enw_add_delay(obs, timestep = "day", copy = TRUE)
obs |
A |
timestep |
The timestep to used. This can be a string ("day", "week", "month") or a numeric whole number representing the number of days. |
copy |
Should |
A data.table
of observations with a new column delay
.
Preprocessing functions
enw_add_max_reported()
,
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") + -2:0)
obs$reference_date <- as.Date("2021-01-01")
enw_add_delay(obs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.