mxmaps 2025.0.0
- Update the state and municipios maps with those from the Encuesta Intercensal 2025
- Add new
df_mxstate_2025anddf_mxmunicipio_2025data.frames with data from the Encuesta Intercensal 2025 - Add a CartoDB API key to the leaflet state and municipio pkgdown map examples to avoid to avoid getting a key required watermark
-
mxstate.topoJSONandmxmunicipio.topoJSONare now sf objects. To convert them to TopoJSON you use the following code:
library("geojsonio")
# Convert the topoJSON to spatial object
data(mxstate.topoJSON)
tmpdir <- tempdir()
# Convert sf to GeoJSON string
geojson_str <- geojsonio::geojson_json(mxstate.topoJSON)
# Convert GeoJSON to TopoJSON
topojson_str <- geojsonio::geo2topo(as.character(geojson_str))
# Write to a file
writeLines(topojson_str, file.path(tmpdir, "state.topojson"))mxmaps 2020.3.0
- Add options for showing a scale bar (provide a visual indication of distance and feature size on the map) to
mxstate_choroplethandmxmunicipio_choroplethwith the options:scale_bar_position,scale_bar_length,scale_bar_segments,scale_bar_height,scale_bar_color, andscale_bar_text_color
df_mxstate_2020$value <- df_mxstate_2020$pop
mxstate_choropleth(df_mxstate_2020,
title = "Total population, by state",
title_color = "#635147",
scale_bar = TRUE,
scale_bar_position = "bl",
scale_bar_length = 1000,
scale_bar_segments = 4
)- Add options
background_colorstate_border_sizestate_border_colortomxstate_choropleth,mxhexbin_choropleth, andmxmunicipio_choropleth
df_mxstate_2020$value <- df_mxstate_2020$pop
mxstate_choropleth(df_mxstate_2020,
title = "Total population, by state",
background_color = "#e3dac9",
state_border_size=2,
state_border_color="red"
)- Add options
municipio_border_sizemunicipio_border_colortomxmunicipio_choropleth
df_mxmunicipio_2020$value <- df_mxmunicipio_2020$indigenous_language /
df_mxmunicipio_2020$pop * 100
mxmunicipio_choropleth(df_mxmunicipio_2020,
num_colors = 1,
title = "Percentage of the population that speaks\nan indigenous language",
scale_bar = TRUE,
scale_bar_position = "bl",
scale_bar_length = 1000,
scale_bar_segments = 4,
background_color = "#e3dac9",
title_color = "#635147",
municipio_border_color = "gold",
municipio_border_size = 0.01,
state_border_color = "red",
state_border_size = .5,
legend = "%"
)- Add options
title_color,title_align, andtitle_positiontomxstate_choropleth,mxhexbin_choroplethandmxmunicipio_choropleth
df_mxstate_2020$value <- df_mxstate_2020$pop
mxstate_choropleth(df_mxstate_2020,
title = "Total population, by state",
title_color = "green"
)mxmaps 2020.2.3
- Exlude images in man/figures by adding it to .Rbuildignore
- Update lifecycle badge to stable since maturing was deprecated from the lifecyle package
mxmaps 2020.2.2
- Rename Choroplet R6 class to Choropleth2 to avoid interfering with the choroplethr package
- Update documentation to use bootstrap 5
mxmaps 2020.2.1
- Remove dependency on deprecated package choropletr
- Fix state labels in the state vignette
mxmaps 2020.2.0
- Remove the functions that use the INEGI API since it doesn’t work anymore and correct to a major release version
mxmaps 2020.1.2
- Switches Universal Analytics to Google Analytics 4 in the pkgdown website
- Fixes the municipios examaples to use the df_mxmunicipio_2020 data.frame and avoid the missing municipios warning
- Adds
auto_contrastoption tomxhexbin_choropleth
mxmaps 2020.0.0
New features
- Maps are now based on those of the 2020 Mexican Census
- New data frames
df_mxmunicipio_2020anddf_mxstate_2020with population data from the 2020 Census - New data.frames
df_mxmunicipio_1990_2010anddf_mxstate_1990_2010with population data from the 1990-2010 censuses and conteos - Alias the
df_mxmunicipioanddf_mxstatedata.frames todf_mxmunicipio_2015anddf_mxstate_2015to indicate the year their data is from - Changed the versioning scheme to include the year the shapefiles the maps are based on were published
mxmaps 0.6.1
New features
- Change the progress bar used when downloading from the INEGI API since
progress_estimated()from the dplyr package was deprecated
mxmaps 0.5.1
Bug fixes and improvements
- Better documentation
- pkgdown website https://www.diegovalle.net/mxmaps/