Get unique hierarchical levels from survey data
Source:R/get_geo_unit_index_data.R
get_geo_unit_index_data.RdGet unique hierarchical levels from survey data and assign index "c" based on area.
Value
tibble with unique hierarchical levels (one column for each level) and index "c" assigned based on area
Examples
survey_dat <- tibble::tibble(subcluster = c("A", "A", "B", "B"),
iso = c("iso1", "iso2", "iso3", "iso4"))
get_geo_unit_index_data(survey_dat,
hierarchical_levels = c("intercept", "subcluster", "iso"),
area = "iso")
#> # A tibble: 4 × 3
#> subcluster iso c
#> <chr> <chr> <int>
#> 1 A iso1 1
#> 2 A iso2 2
#> 3 B iso3 3
#> 4 B iso4 4