MXMunicipioChoropleth | R Documentation |
An R6 object for creating municipio-level choropleths.
An R6 object for creating municipio-level choropleths.
mxmaps::Choropleth
-> MXMunicipioChoropleth
show_states
boolean, draw state borders
mxmaps::Choropleth$bind()
mxmaps::Choropleth$clip()
mxmaps::Choropleth$discretize()
mxmaps::Choropleth$format_levels()
mxmaps::Choropleth$get_bounding_box()
mxmaps::Choropleth$get_choropleth_as_polygon()
mxmaps::Choropleth$get_max_lat()
mxmaps::Choropleth$get_max_long()
mxmaps::Choropleth$get_min_lat()
mxmaps::Choropleth$get_min_long()
mxmaps::Choropleth$get_reference_map()
mxmaps::Choropleth$get_scale()
mxmaps::Choropleth$get_x_scale()
mxmaps::Choropleth$get_y_scale()
mxmaps::Choropleth$get_zoom()
mxmaps::Choropleth$prepare_map()
mxmaps::Choropleth$render_with_reference_map()
mxmaps::Choropleth$set_num_colors()
mxmaps::Choropleth$set_zoom()
mxmaps::Choropleth$theme_clean()
mxmaps::Choropleth$theme_inset()
render()
Render the map of Mexico
MXMunicipioChoropleth$render()
user.df
df
A new ggplot2 object with a map of Mexico.
new()
Initialize the map of Mexico
MXMunicipioChoropleth$new(user.df)
user.df
df
A new 'MXMunicipioChoropleth' object.
clone()
The objects of this class are cloneable with this method.
MXMunicipioChoropleth$clone(deep = FALSE)
deep
Whether to make a deep clone.
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.