enw_incidence_to_linelist: Convert Aggregate Counts (Incidence) to a Line List

enw_incidence_to_linelistR Documentation

Convert Aggregate Counts (Incidence) to a Line List

Description

This function takes a data.table of aggregate counts or something coercible to a data.table (such as a data.frame) and converts it to a line list where each row represents a case.

Usage

enw_incidence_to_linelist(
  obs,
  reference_date = "reference_date",
  report_date = "report_date"
)

Arguments

obs

An object coercible to a data.table (such as a data.frame) which must have a new_confirm column.

reference_date

A character string of the variable name to use for the reference_date in the line list. The default is "reference_date".

report_date

A character string of the variable name to use for the report_date in the line list. The default is "report_date".

Value

A data.table with the following variables: id, reference_date, report_date, and any other variables in the obs object. Rows in obs will be duplicated based on the new_confirm column. reference_date and report_date may be renamed if reference_date and report_date are supplied.

See Also

Data converters enw_add_cumulative(), enw_add_incidence(), enw_aggregate_cumulative(), enw_cumulative_to_incidence(), enw_incidence_to_cumulative(), enw_linelist_to_incidence()

Examples

incidence <- enw_add_incidence(germany_covid19_hosp)
incidence <- enw_filter_reference_dates(
  incidence[location == "DE"], include_days = 10
)
enw_incidence_to_linelist(incidence, reference_date = "onset_date")

seabbs/epinowcast documentation built on July 27, 2024, 1:33 p.m.