| Title: | Population Datasets of Mexico at Municipal and Hexagon Resolution |
|---|---|
| Description: | Population datasets of Mexico for epidemiological analysis and to calculate rates: census population by municipality, sex and age group (INEGI ITER 2000, 2010 and 2020), municipal population reconstructions and projections 1990-2040 (CONAPO), and population in 400 m H3 hexagons (Kontur, Humanitarian Data Exchange, 2021-2023), with a function to extract the hexagons of urban localities, and a function to download the LandScan Global population raster (1 km) on demand. |
| Authors: | Felipe Antonio Dzul Manzanilla [aut, cre] (ORCID: <https://orcid.org/0000-0002-2085-9141>), Fabián Correa-Morales [aut] (ORCID: <https://orcid.org/0000-0002-6193-1242>), Cecilia Cruz López [aut] (ORCID: <https://orcid.org/0000-0002-9156-5669>), Emmanuel Morales García [aut] (ORCID: <https://orcid.org/0000-0002-6837-9227>) |
| Maintainer: | Felipe Antonio Dzul Manzanilla <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-10-24 11:27:16 UTC |
| Source: | https://github.com/fdzul/popmex |
Reconstruction (1990-2020) and projections (2021-2040) of the mid-year population of the 2,475 municipalities of Mexico by sex and five-year age group, published by the National Population Council (CONAPO).
conapopconapop
A tibble with 252,450 rows (municipality x sex x year) and 24 columns:
five-digit municipality code of INEGI.
name of the state.
name of the municipality.
sex: '"HOMBRES"' (men) or '"MUJERES"' (women).
year, 1990 to 2040.
population aged 0 to 4 years.
population aged 5 to 9 years.
population aged 10 to 14 years.
population aged 15 to 19 years.
population aged 20 to 24 years.
population aged 25 to 29 years.
population aged 30 to 34 years.
population aged 35 to 39 years.
population aged 40 to 44 years.
population aged 45 to 49 years.
population aged 50 to 54 years.
population aged 55 to 59 years.
population aged 60 to 64 years.
population aged 65 to 69 years.
population aged 70 to 74 years.
population aged 75 to 79 years.
population aged 80 to 84 years.
population aged 85 years and over.
total population.
<https://www.gob.mx/conapo/documentos/reconstruccion-y-proyecciones-de-la-poblacion-de-los-municipios-de-mexico-1990-2040>
Selects the hexagons of the Kontur/HDX population density dataset ('hdx_pop2021', 'hdx_pop2022' or 'hdx_pop2023') that intersect one or several urban localities of a state. The locality boundaries come from the INEGI 2019 localities of the [rgeomex](https://fdzul.github.io/rgeomex/) package.
extract_pop(year = 2023, cve_edo, locality)extract_pop(year = 2023, cve_edo, locality)
year |
year of the population dataset: 2021, 2022 or 2023. |
cve_edo |
two-digit state code of INEGI, as text (e.g. '"14"' for Jalisco, '"31"' for Yucatán). |
locality |
name or names of the target localities. The names do not need to be exact: the most similar name of the state is used (e.g. '"Merida"' finds '"Mérida"'). |
an 'sf' object (EPSG:4326) with the hexagons that intersect the localities and their population ('population').
Felipe Antonio Dzul Manzanilla [email protected].
[hdx_pop2023], [hdx_pop2022], [hdx_pop2021], [rgeomex::extract_locality()]
if (requireNamespace("rgeomex", quietly = TRUE)) { merida <- extract_pop(year = 2023, cve_edo = "31", locality = "Merida") sum(merida$population) }if (requireNamespace("rgeomex", quietly = TRUE)) { merida <- extract_pop(year = 2023, cve_edo = "31", locality = "Merida") sum(merida$population) }
Downloads (only the first time) the LandScan population raster of Mexico published as an asset of a GitHub release of popmex, and returns it as a 'SpatRaster'. The file is kept in a local cache, so later calls read it from disk without downloading it again.
get_landscan( url = "https://github.com/fdzul/popmex/releases/download/landscan-data/pop_LandScan.tif", refresh = FALSE )get_landscan( url = "https://github.com/fdzul/popmex/releases/download/landscan-data/pop_LandScan.tif", refresh = FALSE )
url |
address of the file. By default, the asset 'pop_LandScan.tif' of the release 'landscan-data' of the popmex repository. |
refresh |
if 'TRUE', download the file again even if it is cached. |
a 'terra::SpatRaster' with the estimated population per cell.
Felipe Antonio Dzul Manzanilla [email protected].
LandScan Global, Oak Ridge National Laboratory (ORNL), <https://landscan.ornl.gov>.
if (requireNamespace("terra", quietly = TRUE)) { r <- get_landscan() r }if (requireNamespace("terra", quietly = TRUE)) { r <- get_landscan() r }
Estimated number of inhabitants in each H3 hexagon of resolution 8 (about 400 m across) of Mexico, from the Kontur Population dataset published in the Humanitarian Data Exchange (HDX). Only hexagons with population are included. This edition has no 'h3' column.
hdx_pop2021hdx_pop2021
An 'sf' data frame (EPSG:4326, MULTIPOLYGON geometries) with 362,028 rows:
estimated number of inhabitants in the hexagon.
hexagon geometry.
<https://data.humdata.org/dataset/kontur-population-mexico>
[extract_pop()] to extract the hexagons of a locality.
Estimated number of inhabitants in each H3 hexagon of resolution 8 (about 400 m across) of Mexico, from the Kontur Population dataset published in the Humanitarian Data Exchange (HDX). Only hexagons with population are included.
hdx_pop2022hdx_pop2022
An 'sf' data frame (EPSG:4326, POLYGON geometries) with 463,830 rows:
H3 index of the hexagon (resolution 8).
estimated number of inhabitants in the hexagon.
hexagon geometry.
<https://data.humdata.org/dataset/kontur-population-mexico>
[extract_pop()] to extract the hexagons of a locality.
Estimated number of inhabitants in each H3 hexagon of resolution 8 (about 400 m across) of Mexico, from the Kontur Population dataset published in the Humanitarian Data Exchange (HDX). Only hexagons with population are included.
hdx_pop2023hdx_pop2023
An 'sf' data frame (EPSG:4326, POLYGON geometries) with 456,514 rows:
H3 index of the hexagon (resolution 8).
estimated number of inhabitants in the hexagon.
hexagon geometry.
<https://data.humdata.org/dataset/kontur-population-mexico>
[extract_pop()] to extract the hexagons of a locality.
Population of each municipality of Mexico by sex and age group, from the territorial indicators (ITER, *Integración Territorial*) of the 2000 Population and Housing Census of INEGI. Useful as denominators to calculate incidence rates.
pop2000pop2000
A tibble with 2,443 rows (municipalities) and 4 columns. All population columns are numeric:
five-digit municipality code of INEGI (state + municipality).
total population.
female population.
male population.
<https://www.inegi.org.mx/app/scitel/Default?ev=9>
Population of each municipality of Mexico by sex and age group, from the territorial indicators (ITER, *Integración Territorial*) of the 2010 Population and Housing Census of INEGI. Useful as denominators to calculate incidence rates.
pop2010pop2010
A tibble with 2,456 rows (municipalities) and 44 columns. All population columns are numeric:
five-digit municipality code of INEGI (state + municipality).
total population.
female population.
male population.
population aged 0 to 2 years.
female population aged 0 to 2 years.
male population aged 0 to 2 years.
population aged 3 years and over.
female population aged 3 years and over.
male population aged 3 years and over.
population aged 5 years and over.
female population aged 5 years and over.
male population aged 5 years and over.
population aged 12 years and over.
female population aged 12 years and over.
male population aged 12 years and over.
population aged 15 years and over.
female population aged 15 years and over.
male population aged 15 years and over.
population aged 18 years and over.
female population aged 18 years and over.
male population aged 18 years and over.
population aged 3 to 5 years.
female population aged 3 to 5 years.
male population aged 3 to 5 years.
population aged 6 to 11 years.
female population aged 6 to 11 years.
male population aged 6 to 11 years.
population aged 8 to 14 years.
female population aged 8 to 14 years.
male population aged 8 to 14 years.
population aged 12 to 14 years.
female population aged 12 to 14 years.
male population aged 12 to 14 years.
population aged 15 to 17 years.
female population aged 15 to 17 years.
male population aged 15 to 17 years.
population aged 18 to 24 years.
female population aged 18 to 24 years.
male population aged 18 to 24 years.
female population aged 15 to 49 years.
population aged 60 years and over.
female population aged 60 years and over.
male population aged 60 years and over.
<https://www.inegi.org.mx/app/scitel/Default?ev=9>
Population of each municipality of Mexico by sex and age group, from the territorial indicators (ITER, *Integración Territorial*) of the 2020 Population and Housing Census of INEGI. Useful as denominators to calculate incidence rates.
pop2020pop2020
A tibble with 2,469 rows (municipalities) and 44 columns. All population columns are numeric:
five-digit municipality code of INEGI (state + municipality).
total population.
female population.
male population.
population aged 0 to 2 years.
female population aged 0 to 2 years.
male population aged 0 to 2 years.
population aged 3 years and over.
female population aged 3 years and over.
male population aged 3 years and over.
population aged 5 years and over.
female population aged 5 years and over.
male population aged 5 years and over.
population aged 12 years and over.
female population aged 12 years and over.
male population aged 12 years and over.
population aged 15 years and over.
female population aged 15 years and over.
male population aged 15 years and over.
population aged 18 years and over.
female population aged 18 years and over.
male population aged 18 years and over.
population aged 3 to 5 years.
female population aged 3 to 5 years.
male population aged 3 to 5 years.
population aged 6 to 11 years.
female population aged 6 to 11 years.
male population aged 6 to 11 years.
population aged 8 to 14 years.
female population aged 8 to 14 years.
male population aged 8 to 14 years.
population aged 12 to 14 years.
female population aged 12 to 14 years.
male population aged 12 to 14 years.
population aged 15 to 17 years.
female population aged 15 to 17 years.
male population aged 15 to 17 years.
population aged 18 to 24 years.
female population aged 18 to 24 years.
male population aged 18 to 24 years.
female population aged 15 to 49 years.
population aged 60 years and over.
female population aged 60 years and over.
male population aged 60 years and over.
<https://www.inegi.org.mx/app/scitel/Default?ev=9>