Constructs the reporting triangle with each row representing a reference date and columns being observations by report date
Arguments
- obs
A
data.frame
as produced byenw_add_incidence()
. Must contain the following variables:reference_date
,.group
,delay
.
Value
A data.frame
with each row being a reference date, and columns
being observations by reporting 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_delay()
,
enw_metadata()
,
enw_missing_reference()
,
enw_preprocess_data()
,
enw_reporting_triangle_to_long()
Examples
obs <- enw_example("preprocessed")$new_confirm
enw_reporting_triangle(obs)
#> Key: <.group, reference_date>
#> .group reference_date 0 1 2 3 4 5 6 7 8
#> <num> <IDat> <int> <int> <int> <int> <int> <int> <int> <int> <int>
#> 1: 1 2021-07-13 21 12 3 4 3 0 1 2 4
#> 2: 1 2021-07-14 22 12 4 5 0 1 10 2 5
#> 3: 1 2021-07-15 28 15 3 3 0 1 3 2 3
#> 4: 1 2021-07-16 19 13 0 0 0 4 2 2 2
#> 5: 1 2021-07-17 20 7 1 3 10 3 0 4 3
#> 6: 1 2021-07-18 9 6 6 0 4 5 4 0 1
#> 7: 1 2021-07-19 3 16 4 4 1 1 2 0 0
#> 8: 1 2021-07-20 36 19 10 4 2 3 0 3 2
#> 9: 1 2021-07-21 28 18 8 4 1 2 3 6 1
#> 10: 1 2021-07-22 34 19 2 1 5 2 4 3 7
#> 11: 1 2021-07-23 30 12 4 1 10 6 0 2 2
#> 12: 1 2021-07-24 31 8 4 9 8 2 5 2 1
#> 13: 1 2021-07-25 8 4 14 8 6 5 1 3 0
#> 14: 1 2021-07-26 9 6 2 3 0 0 0 0 1
#> 15: 1 2021-07-27 35 11 6 4 4 1 0 2 2
#> 16: 1 2021-07-28 51 28 25 3 5 2 3 5 5
#> 17: 1 2021-07-29 47 37 9 2 2 3 4 4 4
#> 18: 1 2021-07-30 36 20 2 4 11 8 8 3 5
#> 19: 1 2021-07-31 38 16 3 15 14 7 5 5 0
#> 20: 1 2021-08-01 7 5 5 11 7 5 1 3 1
#> 21: 1 2021-08-02 13 13 8 6 1 3 2 0 0
#> 22: 1 2021-08-03 51 43 6 4 4 3 1 6 4
#> 23: 1 2021-08-04 51 43 18 5 6 1 2 8 7
#> 24: 1 2021-08-05 45 21 6 2 2 11 17 5 7
#> 25: 1 2021-08-06 47 31 5 4 20 6 1 9 3
#> 26: 1 2021-08-07 40 15 6 23 14 13 8 9 0
#> 27: 1 2021-08-08 13 14 27 14 7 7 0 0 0
#> 28: 1 2021-08-09 14 23 11 3 1 1 0 0 0
#> 29: 1 2021-08-10 78 43 23 11 5 1 0 5 2
#> 30: 1 2021-08-11 80 53 17 15 7 3 14 12 13
#> 31: 1 2021-08-12 89 48 28 8 1 14 13 13 10
#> 32: 1 2021-08-13 86 44 9 3 27 13 7 11 4
#> 33: 1 2021-08-14 79 36 7 16 19 13 8 8 3
#> 34: 1 2021-08-15 22 24 35 18 10 4 7 5 0
#> 35: 1 2021-08-16 23 32 22 10 8 2 1 0 0
#> 36: 1 2021-08-17 96 85 30 18 10 3 0 0 0
#> 37: 1 2021-08-18 92 86 23 18 4 0 0 0 0
#> 38: 1 2021-08-19 84 87 27 4 0 0 0 0 0
#> 39: 1 2021-08-20 98 61 12 0 0 0 0 0 0
#> 40: 1 2021-08-21 69 43 0 0 0 0 0 0 0
#> 41: 1 2021-08-22 45 0 0 0 0 0 0 0 0
#> .group reference_date 0 1 2 3 4 5 6 7 8
#> 9 10 11 12 13 14 15 16 17 18 19
#> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int>
#> 1: 3 0 0 2 0 0 0 1 2 1 0
#> 2: 3 0 1 0 3 1 0 1 0 0 0
#> 3: 2 1 0 2 3 0 3 0 0 0 0
#> 4: 1 1 1 0 1 0 0 1 0 0 0
#> 5: 3 2 0 1 2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