
Fix unknown GUIDs in the AFP linelist
fix_ctry_data_missing_guids.RdFix unknown GUIDs in the AFP linelist by obtaining GUIDs found in the pop files. It attempts to replace the unknown GUIDs from the AFP linelist by using geographic info for a specific year that coincides with the case date and uses the GUIDs contained in the current spatial data instead.
Arguments
- afp.data
tibbleAFP linelist (afp.all.2).- pop.data
tibblePopulation file (prov.pop or dist.pop).- guid_list
str listUnknown GUIDs from the AFP linelist. This is the output ofcheck_afp_guid_ctry_data().- spatial_scale
strThe spatial scale to impute data. Either"prov"or"dist".
Examples
if (FALSE) { # \dontrun{
raw.data <- get_all_polio_data()
ctry.data <- extract_country_data("algeria", raw.data)
error.list <- check_afp_guid_ctry_data(ctry.data)
ctry.data$afp.all.2 <- fix_ctry_data_missing_guids(
ctry.data$afp.all.2,
ctry.data$dist.pop,
error.list$dist_mismatches_pop,
"dist"
)
} # }