Logo Lanfrica

Heed725/rTanzaniaCensus

Domain:

socioeconomic

Record type:

softwaredataset
Creator:
Hee
Host:
Tanzania 2022 Population and Housing Census data and administrative boundaries for R # 🇹🇿 rTanzaniaCensus ### Tanzania historical and 2022 Population and Housing Census data for R Population tables · Administrative boundaries · Electoral constituencies --- ## About `rTanzaniaCensus` makes Tanzania's historical and 2022 Population and Housing Census totals and related boundary layers easy to use in R. Population tables are returned as ordinary data frames. Spatial layers are read as modern `sf` objects only when requested. The package is inspired by the structure and accessibility goals of `rKenyaCensus`. ## Included data | Dataset | Records | Access command | |:---|---:|:---| | National census history, 1967–2022 | 6 census years | `census_population_history()` | | Comparable Mainland regional history | 26 regions × 3 years | `census_regions_historical()` | | 2022 regional population | 31 | `census_regions()` | | 2022 district population | 195 | `census_districts()` | | 2022 ward population | 4,333 | `census_wards()` | | Regional boundaries | 31 regions | `admin_boundaries("region")` | | District-council boundaries | Spatial layer | `admin_boundaries("district")` | | Ward boundaries | Spatial layer | `admin_boundaries("ward")` | | Village boundaries | Spatial layer | `admin_boundaries("village")` | | Constituency boundaries | Spatial layer | `admin_boundaries("constituency")` | Run `census_catalogue()` inside R for the complete package catalogue. ## Installation Install the development version from GitHub: ```r install.packages("remotes") remotes::install_github("Heed725/rTanzaniaCensus") ``` Or install a downloaded source archive: ```r install.packages( "rTanzaniaCensus_0.2.0.tar.gz", repos = NULL, type = "source" ) ``` Load the package: ```r library(rTanzaniaCensus) ``` ## Population examples ```r regions left_join(region_population, by = "reg_name") ggplot(tanzania_regions) + geom_sf( aes(fill = population), colour = "white", linewidth = 0.3 ) + geom_sf_text( aes(label = reg_name), size = 2.4, check_overlap = TRUE ) + sca …