The map used is mxmunicipio.map. See ?mxmunicipio.map for more information.

mxmunicipio_choropleth(
  df,
  title = "",
  legend = "",
  num_colors = 7,
  zoom = NULL,
  show_states = TRUE
)

Arguments

df

A data.frame with a column named "region" and a column named "value". Elements in the "region" column must match the numeric codes in the "region" column of ?df_mxmunicipio either with a leading zero or without one (e.g. 01001 or 1001 are both fine)

title

An optional title for the map.

legend

An optional name for the legend.

num_colors

The number of colors to use on the map. A value of 1 will use a continuous scale, and a value in [2, 9] will use that many colors.

zoom

An optional vector of countries to zoom in on. Elements of this vector must exactly match the names of countries as they appear in the "region" column of ?country.regions

show_states

Wether to draw state borders.

Examples

df <- df_mxmunicipio df$value <- df$indigenous mxmunicipio_choropleth(df)
#> Warning: The following regions were missing and are being set to NA: 02006, 04012, 07120, 07121, 07122, 07123, 07124, 07125, 17034, 17035, 17036, 23011