English · Español

popmex

Overview

popmex provides population datasets of Mexico at municipal and hexagon (400 m) resolution, to calculate incidence rates and to map where people live in urban localities.

Population is the denominator of every rate and the exposure of every spatial model. popmex gathers in one place the census population by municipality, sex and age group (INEGI 2000, 2010 and 2020), the CONAPO reconstructions and projections for 1990-2040, the population in 400 m H3 hexagons (Kontur 2021-2023) to work inside cities, and the LandScan Global population raster (1 km), downloaded on demand with get_landscan().

popmex is part of the dengueverse, a family of R packages for the surveillance, spatial analysis and control of dengue and other Aedes-borne diseases in Mexico.

Datasets

Dataset Description Source
conapop Population of the municipalities of Mexico, 1990-2040 (CONAPO) link
hdx_pop2021 Population in 400 m H3 hexagons of Mexico, 2021 (Kontur / HDX) link
hdx_pop2022 Population in 400 m H3 hexagons of Mexico, 2022 (Kontur / HDX) link
hdx_pop2023 Population in 400 m H3 hexagons of Mexico, 2023 (Kontur / HDX) link
pop2000 Population by municipality of Mexico, ITER 2000 link
pop2010 Population by municipality of Mexico, ITER 2010 link
pop2020 Population by municipality of Mexico, ITER 2020 link

See the full description of each dataset with ?name.

Main functions

Function Description
extract_pop() Extract the population of a locality in 400 m H3 hexagons
get_landscan() Download the LandScan population raster of Mexico

Installation

Install the released version from the dengueverse R-universe:

install.packages("popmex",
                 repos = c("https://fdzul.r-universe.dev",
                           "https://cloud.r-project.org"))

Or the development version from GitHub:

# install.packages("pak")
pak::pak("fdzul/popmex")

Example

library(popmex)

# population in 400 m hexagons of the metropolitan area of Mérida, 2023
merida <- extract_pop(year = 2023, cve_edo = "31",
                      locality = c("Merida", "Uman", "Kanasin"))
sum(merida$population)

# census population of each municipality in 2020 (denominator of rates)
head(pop2020[, c("CVEGEO", "pobtot", "pobfem", "pobmas")])

Longer examples are in the articles of the website.

Data sources

Processing scripts are in data-raw/.

How to cite

If you use popmex in a publication, please cite it:

Dzul Manzanilla F, Correa-Morales F, Cruz López C, Morales García E (2026). _popmex: Population
Datasets of Mexico at Municipal and Hexagon Resolution_. R package version 0.2.0,
<https://fdzul.r-universe.dev/popmex>.

Authors and contributors

Acknowledgements

This work was developed at the Instituto Nacional de Salud Pública (INSP), Mexico, in collaboration with the Centro Nacional de Programas Preventivos y Control de Enfermedades (CENAPRECE) of the Secretaría de Salud.

Motivation

popmex was born from the need to support evidence-based decisions in the Vector-Borne Diseases (VBD) program of CENAPRECE of the Secretaría de Salud of Mexico.

Getting help

Disclaimer

The datasets in popmex are derived from public sources and are provided for research and public-health purposes. They are not an official product of the original institutions; please check the original sources for official figures.

License

MIT © 2026 Felipe Antonio Dzul Manzanilla. See LICENSE.md.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.