
Simulate a Complete Set of Polio Surveillance Tables
Source:R/simulate_polio_data.R
simulate_polio_data.RdBuilds one synthetic geography and, on it, the district population, the AFP cases, the environmental samples, the virus detections drawn from them, the stool specimens of the cases and the campaign rounds. The tables share their districts, GUIDs and identifiers, so they join as the real tables do.
Arguments
- start_date, end_date
The window every table covers. Defaults
as.Date("2023-01-01")andas.Date("2024-12-31"). The population covers each calendar year the window touches.- admin_args
Further arguments to
simulate_admin_frame(), as a named list. Defaultlist().- population_args
Further arguments to
simulate_population(). Defaultlist().- afp_args
Further arguments to
simulate_afp_cases(). Defaultlist().- es_args
Further arguments to
simulate_es_samples(). Defaultlist().- detection_args
Further arguments to
simulate_detections(). Defaultlist().- specimen_args
Further arguments to
simulate_human_specimens(). Defaultlist().- campaign_args
Further arguments to
simulate_campaigns(). Defaultlist().- seed
Seed for the random draws. Default
1L. The geography usesseed, the populationseed + 1, the casesseed + 2, the samplesseed + 3, the specimensseed + 4and the campaignsseed + 5. The caller's random state is left as it was.
Value
A named list of tibbles: admin, population, afp_cases,
es_samples, detections, human_specimens and campaigns.
Details
Each table is drawn with its own seed, taken from seed in turn, so
changing the arguments of one table leaves the others unchanged.
Examples
polio <- simulate_polio_data(
admin_args = list(n_provinces = 2, n_districts = 3)
)
names(polio)
#> [1] "admin" "population" "afp_cases" "es_samples"
#> [5] "detections" "human_specimens" "campaigns"
polio$detections
#> # A tibble: 25 × 26
#> epid surveillance_type source country_iso3code adm0 adm1 adm2 adm0_guid
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 ENV-QZ… environmental Envir… QZA COUN… PROV… DIST… {83601C6…
#> 2 ENV-QZ… environmental Envir… QZA COUN… PROV… DIST… {83601C6…
#> 3 QZA-P0… human AFP QZA COUN… PROV… DIST… {83601C6…
#> 4 ENV-QZ… environmental Envir… QZA COUN… PROV… DIST… {83601C6…
#> 5 QZA-P0… human AFP QZA COUN… PROV… DIST… {83601C6…
#> 6 ENV-QZ… environmental Envir… QZA COUN… PROV… DIST… {83601C6…
#> 7 ENV-QZ… environmental Envir… QZA COUN… PROV… DIST… {83601C6…
#> 8 QZA-P0… human AFP QZA COUN… PROV… DIST… {83601C6…
#> 9 QZA-P0… human AFP QZA COUN… PROV… DIST… {83601C6…
#> 10 ENV-QZ… environmental Envir… QZA COUN… PROV… DIST… {83601C6…
#> # ℹ 15 more rows
#> # ℹ 18 more variables: adm1_guid <chr>, adm2_guid <chr>, latitude <dbl>,
#> # longitude <dbl>, vtype <chr>, classification_all <chr>, measurement <chr>,
#> # emergence_group <chr>, nt_changes <chr>, virus_cluster <chr>,
#> # virus_is_orphan <lgl>, vdpv_classification_change_date <date>,
#> # virus_date <date>, year_onset <int>, month_onset <int>,
#> # notification_date <date>, report_date <date>, source_system <chr>