An R6 object for creating municipio-level choropleths.
Source:R/municipio.R
MXMunicipioChoropleth.RdAn R6 object for creating municipio-level choropleths.
Super class
Choropleth2 -> MXMunicipioChoropleth
Methods
Inherited methods
Choropleth2$bind()Choropleth2$clip()Choropleth2$discretize()Choropleth2$format_levels()Choropleth2$get_bounding_box()Choropleth2$get_choropleth_as_polygon()Choropleth2$get_max_lat()Choropleth2$get_max_long()Choropleth2$get_min_lat()Choropleth2$get_min_long()Choropleth2$get_reference_map()Choropleth2$get_scale()Choropleth2$get_x_scale()Choropleth2$get_y_scale()Choropleth2$get_zoom()Choropleth2$prepare_map()Choropleth2$render_with_reference_map()Choropleth2$set_num_colors()Choropleth2$set_zoom()Choropleth2$theme_clean()Choropleth2$theme_inset()
Examples
library(viridis)
library(scales)
df_mxmunicipio_2020$value <- df_mxmunicipio_2020$indigenous_language /
df_mxmunicipio_2020$pop
gg <- MXMunicipioChoropleth$new(df_mxmunicipio_2020)
gg$title <- "Percentage of the population that self-identifies as indigenous"
gg$set_num_colors(1)
gg$ggplot_scale <- scale_fill_viridis("percent", labels = percent)
gg$render()