Skip to contents

Uses RM032 (NM_2132_1), available at Census 2021 small areas. Five published age bands are combined to under 25, 25-34 and 35+, the common partition with police age bands. Census sex and police-recorded gender are different measurements; any analysis using them must state this assumption. Unsupported geography returns NULL and a message. No age-sex cross-tabulation is imputed from marginal totals.

Usage

sl_population_crosstab(
  geography,
  dir = sl_cache_dir(),
  classification = c("5", "19")
)

Arguments

geography

ONS geography codes, or an sf layer with geography_code.

dir

Explicit cache directory, written only on this call.

classification

Census classification, 5 or 19.

Value

An sl_exposure tibble with age_band and sex, or NULL.

Examples

p <- readRDS(system.file("extdata", "sample-crosstab.rds",
  package = "searchlight"
))
head(p)
#> # A tibble: 6 × 5
#>   geography_code ethnicity age_band sex    population
#>   <chr>          <chr>     <chr>    <chr>       <dbl>
#> 1 E02002183      Asian     25-34    Female          4
#> 2 E02002183      Asian     25-34    Male            2
#> 3 E02002183      Asian     35+      Female         22
#> 4 E02002183      Asian     35+      Male           23
#> 5 E02002183      Asian     under 25 Female          2
#> 6 E02002183      Asian     under 25 Male            5