An R6 object for creating state-level choropleths.
An R6 object for creating state-level choropleths.
Super class
mxmaps::Choropleth2
-> MXStateChoropleth
Methods
Inherited methods
mxmaps::Choropleth2$bind()
mxmaps::Choropleth2$clip()
mxmaps::Choropleth2$discretize()
mxmaps::Choropleth2$format_levels()
mxmaps::Choropleth2$get_bounding_box()
mxmaps::Choropleth2$get_choropleth_as_polygon()
mxmaps::Choropleth2$get_max_lat()
mxmaps::Choropleth2$get_max_long()
mxmaps::Choropleth2$get_min_lat()
mxmaps::Choropleth2$get_min_long()
mxmaps::Choropleth2$get_reference_map()
mxmaps::Choropleth2$get_scale()
mxmaps::Choropleth2$get_x_scale()
mxmaps::Choropleth2$get_y_scale()
mxmaps::Choropleth2$get_zoom()
mxmaps::Choropleth2$prepare_map()
mxmaps::Choropleth2$render()
mxmaps::Choropleth2$render_with_reference_map()
mxmaps::Choropleth2$set_num_colors()
mxmaps::Choropleth2$set_zoom()
mxmaps::Choropleth2$theme_clean()
mxmaps::Choropleth2$theme_inset()
Examples
library(viridis)
library(scales)
df_mxstate$value <- df_mxstate$indigenous / df_mxstate$pop
gg = MXStateChoropleth$new(df_mxstate)
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()