Recast the reporting triangle from wide to long format
Source:R/preprocess.R
enw_reporting_triangle_to_long.Rd
Recast the reporting triangle from wide to long format
Arguments
- obs
A
data.frame
in the format produced byenw_reporting_triangle()
.
Value
A long format reporting triangle as a data.frame
with additional
variables new_confirm
and delay
.
See also
Preprocessing functions
enw_add_delay()
,
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()
Examples
obs <- enw_example("preprocessed")$new_confirm
rt <- enw_reporting_triangle(obs)
enw_reporting_triangle_to_long(rt)
#> Key: <.group, reference_date, delay>
#> reference_date .group delay new_confirm
#> <IDat> <num> <fctr> <int>
#> 1: 2021-07-13 1 0 21
#> 2: 2021-07-13 1 1 12
#> 3: 2021-07-13 1 2 3
#> 4: 2021-07-13 1 3 4
#> 5: 2021-07-13 1 4 3
#> ---
#> 816: 2021-08-22 1 15 0
#> 817: 2021-08-22 1 16 0
#> 818: 2021-08-22 1 17 0
#> 819: 2021-08-22 1 18 0
#> 820: 2021-08-22 1 19 0