Skip to contents

Builds 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.

Usage

simulate_polio_data(
  start_date = as.Date("2023-01-01"),
  end_date = as.Date("2024-12-31"),
  admin_args = list(),
  population_args = list(),
  afp_args = list(),
  es_args = list(),
  detection_args = list(),
  specimen_args = list(),
  campaign_args = list(),
  seed = 1L
)

Arguments

start_date, end_date

The window every table covers. Defaults as.Date("2023-01-01") and as.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. Default list().

population_args

Further arguments to simulate_population(). Default list().

afp_args

Further arguments to simulate_afp_cases(). Default list().

es_args

Further arguments to simulate_es_samples(). Default list().

detection_args

Further arguments to simulate_detections(). Default list().

specimen_args

Further arguments to simulate_human_specimens(). Default list().

campaign_args

Further arguments to simulate_campaigns(). Default list().

seed

Seed for the random draws. Default 1L. The geography uses seed, the population seed + 1, the cases seed + 2, the samples seed + 3, the specimens seed + 4 and the campaigns seed + 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>