library("mxmaps")
library("ggrepel")
df_mxmunicipio$value <- df_mxmunicipio$indigenous / df_mxmunicipio$pop * 100
chih <- subset(df_mxmunicipio, state_name %in% c("Chihuahua"))
p <- mxmunicipio_choropleth(df_mxmunicipio, num_colors = 1,
zoom = chih$region,
title = "Percentage of the population that self-identifies\nas indigenous in Chihuahua",
show_states = FALSE,
legend = "%")
labels <- chih
labels$group <- NA
labels <- subset(labels, pop > 1e05)
p +
geom_text_repel(data = labels,
aes(long, lat, label = municipio_name),
nudge_x = .1,
nudge_y = .7) +
geom_point(data = labels,
aes(long, lat),
color = "#d6604d",
size = 1)