English · Español
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.
| 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.
| Function | Description |
|---|---|
extract_pop() |
Extract the population of a locality in 400 m H3 hexagons |
get_landscan() |
Download the LandScan population raster of Mexico |
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")
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.
hdx_pop2021, hdx_pop2022, hdx_pop2023),
published in the Humanitarian Data
Exchange.
License: CC BY 4.0.pop2000,
pop2010, pop2020),
INEGI. Population
columns converted to numeric; totals checked against INEGI.get_landscan()), Oak Ridge National
Laboratory, 1 km resolution. License: CC
BY 4.0. The raster is not installed with the package: it is published
as an asset of the landscan-data
release
and downloaded, only once, the first time get_landscan() is called.
Cite the LandScan edition you use (e.g. Sims K, et al. (2023).
LandScan Global 2022 [Data set]. Oak Ridge National Laboratory.
https://doi.org/10.48690/1529167).conapop),
CONAPO.Processing scripts are in
data-raw/.
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>.
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.
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.
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.
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.