Download population and socioeconomic data from the Brazilian Census at a fine spatial resolution for the cities included in the AOP project. See the documentation 'Details' for the data dictionary. The data set reports information for each heaxgon in a H3 spatial grid at resolution 9, with a side of 174 meters and an area of 0.10 km2. More information about H3 at https://h3geo.org/docs/core-library/restable/.

read_population(
  city = NULL,
  year = 2010,
  geometry = FALSE,
  showProgress = TRUE
)

Arguments

city

Character. A city name or three-letter abbreviation. If city="all", the function returns data for all cities.

year

Numeric. A year number in YYYY format. Defaults to 2019.

geometry

Logical. If FALSE (the default), returns a regular data.table of aop data. If TRUE, returns an sf data.frame with simple feature geometry of spatial hexagonal grid H3. See details in read_grid.

showProgress

Logical. Defaults to TRUE display progress bar.

Value

A data.frame object or an sf data.frame object

Data dictionary:

data_typecolumndescriptionvalues
temporalyearYear of reference
geographicid_hexUnique id of hexagonal cell
geographicabbrev_muniAbbreviation of city name (3 letters)
geographicname_muniCity name
geographiccode_muni7-digit code of each city
sociodemographicP001Total number of residents
sociodemographicP002Number of white residents
sociodemographicP003Number of black residents
sociodemographicP004Number of indigenous residents
sociodemographicP005Number of asian-descendents residents
sociodemographicP006Number of men
sociodemographicP007Number of women
sociodemographicP010Number of people between 0 and 5 years old
sociodemographicP011Number of people between 6 and 14 years old
sociodemographicP012Number of people between 15 and 18 years old
sociodemographicP013Number of people between 19 and 24 years old
sociodemographicP014Number of people between 25 and 39 years old
sociodemographicP015Number of people between 40 and 69 years old
sociodemographicP016Number of people with 70 years old or more
sociodemographicR001Average household income per capitaR$ (Brazilian Reais), values in 2010
sociodemographicR002Income quintile group1 (poorest), 2, 3, 4, 5 (richest)
sociodemographicR003Income decile group1 (poorest), 2, 3, 4, 5, 6, 7, 8, 9, 10 (richest)

Cities available

City nameThree-letter abbreviation
Belembel
Belo Horizontebho
Brasiliabsb
Campinascam
Campo Grandecgr
Curitibacur
Duque de Caxiasduq
Fortalezafor
Goianiagoi
Guarulhosgua
Maceiomac
Manausman
Natalnat
Porto Alegrepoa
Reciferec
Rio de Janeirorio
Salvadorsal
Sao Goncalosgo
Sao Luisslz
Sao Paulospo

Examples

# a single city
bho <- read_population(city = 'Belo Horizonte', year = 2010, showProgress = FALSE)
bho <- read_population(city = 'bho', year = 2010, showProgress = FALSE)

# all cities
all <- read_population(city = 'all', year = 2010)