Skip to contents

Load sf district polygons

Usage

load_districts(year = 2020)

Arguments

year

integer(1). census year to load. Defaults to 2020.

Value

An sf object containing the district polygons.

Details

The function loads district polygons for the specified year from the package's extdata directory. The polygons are stored in an RDS file and are read using the readRDS function. The polygons are in the Simple Features (sf) format, which is suitable for spatial data analysis in R. The polygons include following attributes:

  • year: The census year (e.g., 2020).

  • adm2_code: The administrative code for the district.

Examples

library(sf)
#> Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.4.0; sf_use_s2() is TRUE
sf_use_s2(FALSE)
#> Spherical geometry (s2) switched off
sf_2020 <- load_districts(year = 2020)