An R6 object for creating state-level choropleths.
An R6 object for creating state-level choropleths.
choroplethr::Choropleth
-> MXStateChoropleth
Inherited methods
choroplethr::Choropleth$bind()
choroplethr::Choropleth$clip()
choroplethr::Choropleth$discretize()
choroplethr::Choropleth$format_levels()
choroplethr::Choropleth$get_bounding_box()
choroplethr::Choropleth$get_choropleth_as_polygon()
choroplethr::Choropleth$get_max_lat()
choroplethr::Choropleth$get_max_long()
choroplethr::Choropleth$get_min_lat()
choroplethr::Choropleth$get_min_long()
choroplethr::Choropleth$get_reference_map()
choroplethr::Choropleth$get_scale()
choroplethr::Choropleth$get_x_scale()
choroplethr::Choropleth$get_y_scale()
choroplethr::Choropleth$get_zoom()
choroplethr::Choropleth$prepare_map()
choroplethr::Choropleth$render()
choroplethr::Choropleth$render_with_reference_map()
choroplethr::Choropleth$set_num_colors()
choroplethr::Choropleth$set_zoom()
choroplethr::Choropleth$theme_clean()
choroplethr::Choropleth$theme_inset()
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()