Skip to contents

Returns reports with missing reference dates as well as calculating the proportion of reports for a given reference date that were missing.

Usage

enw_missing_reference(obs)

Arguments

obs

A data.frame as produced by enw_add_incidence(). Must contain the following variables: report_date, reference_date, .group, and confirm, and new_confirm.

Value

A data.table of missing counts and proportions by report date and group.

Examples

obs <- data.frame(
  report_date = c("2021-10-01", "2021-10-03"), reference_date = "2021-10-01",
  confirm = 1
)
obs <- rbind(
  obs,
  data.frame(report_date = "2021-10-04", reference_date = NA, confirm = 4)
)
obs <- enw_complete_dates(obs)
obs <- enw_assign_group(obs)
obs <- enw_add_incidence(obs)
enw_missing_reference(obs)
#> Key: <.group, report_date>
#>    report_date .group confirm prop_missing
#>         <IDat>  <num>   <num>        <num>
#> 1:  2021-10-01      1       0            0
#> 2:  2021-10-02      1       0          NaN
#> 3:  2021-10-03      1       0          NaN
#> 4:  2021-10-04      1       4            1