backfill_input_data: Backfill missing historical data

Description Usage Arguments Details Value

Description

Fill missing historical estimates of data using the earliest available data value.

Usage

1
backfill_input_data(input_data, index_field, check_vals)

Arguments

input_data

Input data.table containing input data. The field 'year' (int) is expected

index_field

Field containing unique geographic identifiers by location

check_vals

Values of the index field to check for backfilling

Details

This fix is relevant for administrative boundaries that have changed over time. At the province level, this is relevant for Sud Sardegna province, which is generally listed as its previous component provinces through 2016. Sud Sardegna is a composite of territories from several now-defunct provinces, including the full territories of Medio Campidano and Carbonia-Iglesias provinces. Because there is not an exact correspondence with provinces before 2017, replicate the oldest available data for Sud Sardegna to previous years.

The same issue applies to data preparation for the communes (comuna), which have less stable boundaries than regions and provinces. Currently in the data preparation workflow, preparing population is required to match the subset of communes available for deaths.

Value

Updated data.table with values for Sud Sardegna across all years


njhenry/covidemr documentation built on Feb. 2, 2022, 2:31 a.m.