MXMunicipioChoropleth: An R6 object for creating municipio-level choropleths.

MXMunicipioChoroplethR Documentation

An R6 object for creating municipio-level choropleths.

Description

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_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()

diegovalle/mxmaps documentation built on July 4, 2024, 12:42 a.m.