All Projects → diegovalle → mxmaps

diegovalle / mxmaps

Licence: other
An R package for making maps of Mexico

Programming Languages

r
7636 projects
shell
77523 projects

Projects that are alternatives of or similar to mxmaps

mapr
Map species occurrence data
Stars: ✭ 34 (-43.33%)
Mutual labels:  map, r-package
jpndistrict
🗾 Create Japansese Administration Area Maps
Stars: ✭ 18 (-70%)
Mutual labels:  map, r-package
Cartography
Thematic Cartography for R
Stars: ✭ 357 (+495%)
Mutual labels:  map, r-package
php-sorted-collections
Sorted Collections for PHP
Stars: ✭ 22 (-63.33%)
Mutual labels:  map
mlr3spatiotempcv
Spatiotemporal resampling methods for mlr3
Stars: ✭ 43 (-28.33%)
Mutual labels:  r-package
modeltime.ensemble
Time Series Ensemble Forecasting
Stars: ✭ 65 (+8.33%)
Mutual labels:  r-package
coin-map-android
Easily find places to spend sats anywhere on the planet
Stars: ✭ 23 (-61.67%)
Mutual labels:  map
leaflet-tag-filter-button
Adds tag filter control for layers (marker, geojson features etc.) to LeafLet.
Stars: ✭ 48 (-20%)
Mutual labels:  map
Rdpack
R package Rdpack provides functions and macros facilitating writing and management of R documentation.
Stars: ✭ 21 (-65%)
Mutual labels:  r-package
mchtoolbox
⛔ ARCHIVED ⛔ What the Package Does (Title Case)
Stars: ✭ 13 (-78.33%)
Mutual labels:  r-package
SCopeLoomR
R package (compatible with SCope) to create generic .loom files and extend them with other data e.g.: SCENIC regulons, Seurat clusters and markers, ...
Stars: ✭ 25 (-58.33%)
Mutual labels:  r-package
flutter google maps
A Flutter plugin for integrating Google Maps in iOS, Android and Web applications. It is a wrapper of google_maps_flutter for Mobile and google_maps for Web.
Stars: ✭ 86 (+43.33%)
Mutual labels:  map
sledge-formats
C# parsers and formats for Half-Life 1 and related engines.
Stars: ✭ 35 (-41.67%)
Mutual labels:  map
hunspell
High-Performance Stemmer, Tokenizer, and Spell Checker for R
Stars: ✭ 101 (+68.33%)
Mutual labels:  r-package
leaflet.minichart
Leaflet.minichart is a leaflet plugin for adding to a leaflet map small animated charts
Stars: ✭ 27 (-55%)
Mutual labels:  map
gdoc
⛔ ARCHIVED ⛔ An R Markdown Template for Google Docs
Stars: ✭ 30 (-50%)
Mutual labels:  r-package
korona.ws
🗺 Coronavirus interactive map of Poland
Stars: ✭ 74 (+23.33%)
Mutual labels:  map
DaoHang
一个基于百度地图api的demo,采用Material Design设计界面,有全景图、室内地图等功能。
Stars: ✭ 15 (-75%)
Mutual labels:  map
game-map-editor
game-map-editor
Stars: ✭ 17 (-71.67%)
Mutual labels:  map
navdatareader
Navdatareader is a command line tool that uses the atools fs/bgl and fs/writer to store a full flight simulator scenery database into a relational database like Sqlite or MySql.
Stars: ✭ 35 (-41.67%)
Mutual labels:  map

Mexico Choropleths

Diego Valle-Jones August 19, 2021

Master: R build status Coverage Status

Author: Diego Valle-Jones
License: BSD_3
Website: https://www.diegovalle.net/mxmaps/
Forum: Google Group

What does it do?

This package is based on choroplethr and can be used to easily create maps of Mexico at both the state and municipio levels. It also includes functions to create interactive maps using the leaflet package, map INEGI data from its API, and format strings so they match the INEGI state and municipio codes. Be sure to visit the official website.

Installation

For the moment this package is only available from github. For the development version:

if (!require(devtools)) {
    install.packages("devtools")
}
devtools::install_github('diegovalle/mxmaps')

Quick Example

library(mxmaps)

data("df_mxstate_2020")
df_mxstate_2020$value <- df_mxstate_2020$pop
mxstate_choropleth(df_mxstate_2020,
                    title = "Total population, by state") 

##Data

The data.frame that you provide to the plotting functions must have one column named “region” and one column named “value”. The entries for “region” must match the INEGI codes for states (“01”, “02”, etc) and municipios (“01001”, “01002”, etc) either as a string with or without a leading “0” or as numerics. The functions str_mxstate and str_mxmunicipio are provided to easily format codes to the INEGI specification. Also, two example data.frames, df_mxstate_2020 and df_mxmunicipio_2020, are provided with demographic variables from the 2020 census.

data("df_mxstate_2020")
knitr::kable(head(df_mxstate_2020))
region state_name state_name_official state_abbr state_abbr_official year pop pop_male pop_female afromexican indigenous_language
01 Aguascalientes Aguascalientes AGS Ags. 2020 1425607 696683 728924 22425 2539
02 Baja California Baja California BC BC 2020 3769020 1900589 1868431 64362 49130
03 Baja California Sur Baja California Sur BCS BCS 2020 798447 405879 392568 26330 13581
04 Campeche Campeche CAMP Camp. 2020 928363 456939 471424 19319 91801
05 Coahuila Coahuila de Zaragoza COAH Coah. 2020 3146771 1563669 1583102 45976 5527
06 Colima Colima COL Col. 2020 731391 360622 370769 13574 5210
data("df_mxmunicipio_2020")
knitr::kable(head(df_mxmunicipio_2020))
state_code municipio_code region state_name state_name_official state_abbr state_abbr_official municipio_name year pop pop_male pop_female afromexican indigenous_language metro_area long lat
01 001 01001 Aguascalientes Aguascalientes AGS Ags. Aguascalientes 2020 948990 462073 486917 15170 1839 Aguascalientes -102.2960 21.87982
01 002 01002 Aguascalientes Aguascalientes AGS Ags. Asientos 2020 51536 25261 26275 225 22 NA -102.0893 22.23832
01 003 01003 Aguascalientes Aguascalientes AGS Ags. Calvillo 2020 58250 28563 29687 266 76 NA -102.7188 21.84691
01 004 01004 Aguascalientes Aguascalientes AGS Ags. Cosío 2020 17000 8292 8708 2155 7 NA -102.3000 22.36641
01 005 01005 Aguascalientes Aguascalientes AGS Ags. Jesús María 2020 129929 64219 65710 2543 158 Aguascalientes -102.3434 21.96127
01 006 01006 Aguascalientes Aguascalientes AGS Ags. Pabellón de Arteaga 2020 47646 23377 24269 482 52 NA -102.2765 22.14920

Municipios

Here’s another example showing Mexican municipios (similar to counties):

data("df_mxmunicipio_2020")
df_mxmunicipio_2020$value <-  df_mxmunicipio_2020$indigenous_language / df_mxmunicipio_2020$pop 
mxmunicipio_choropleth(df_mxmunicipio_2020, num_colors = 1,
                       title = "Percentage of the population that speaks\nan indigenous language")

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].