An R6 object for creating municipio-level choropleths.

An R6 object for creating municipio-level choropleths.

Super class

choroplethr::Choropleth -> MXMunicipioChoropleth

Public fields

show_states

boolean, draw state borders

Methods

Public methods

Inherited methods

Method render()

Render the map of Mexico

Usage

MXMunicipioChoropleth$render()

Arguments

user.df

df

Returns

A new ggplot2 object with a map of Mexico.


Method new()

Initialize the map of Mexico

Usage

MXMunicipioChoropleth$new(user.df)

Arguments

user.df

df

Returns

A new `MXMunicipioChoropleth` object.


Method clone()

The objects of this class are cloneable with this method.

Usage

MXMunicipioChoropleth$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

library(viridis) library(scales) df_mxmunicipio$value <- df_mxmunicipio$indigenous / df_mxmunicipio$pop gg = MXMunicipioChoropleth$new(df_mxmunicipio) 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()
#> Warning: The following regions were missing and are being set to NA: 02006, 04012, 07120, 07121, 07122, 07123, 07124, 07125, 17034, 17035, 17036, 23011