Skip to contents

The base Choropleth2 object.

Public fields

user.df

input from user

map.df

geometry of the map

choropleth.df

result of binding user data with our map data

title

title for map

legend

title for legend

warn

warn user on clipped or missing values

ggplot_scale

override default scale.

ggplot_polygon

ggplot_polygon

projection_sf

projection_sf

projection

projection

ggplot_sf

ggplot_sf

state_border_color

State polygon border color.

state_border_size

State polygon border width.

municipio_border_color

Municipio polygon border color.

municipio_border_size

Municipio polygon border width.

background_color

Background color.

title_color

Title color.

title_align

Title horizontal alignment.

title_position

Title position.

scale_bar

Draw scale bar.

scale_bar_position

Scale bar position.

scale_bar_length

Scale bar length in km.

scale_bar_segments

Number of segments.

scale_bar_height

Scale bar height.

scale_bar_color

Scale bar color.

scale_bar_text_color

Scale bar text color.

Methods


Choropleth2$new()

a choropleth map is defined by these two variables

Usage

Choropleth2$new(map.df, user.df)

Arguments

map.df

a data.frame of a map

user.df

a data.frame that expresses values for regions of each map


Choropleth2$render()

render

Usage

Choropleth2$render()


Choropleth2$get_min_long()

left

Usage

Choropleth2$get_min_long()


Choropleth2$get_max_long()

right

Usage

Choropleth2$get_max_long()


Choropleth2$get_min_lat()

bottom

Usage

Choropleth2$get_min_lat()


Choropleth2$get_max_lat()

top

Usage

Choropleth2$get_max_lat()


Choropleth2$get_bounding_box()

get_bounding_box

Usage

Choropleth2$get_bounding_box(long_margin_percent, lat_margin_percent)

Arguments

long_margin_percent

null

lat_margin_percent

null


Choropleth2$get_x_scale()

get_x_scale

Usage

Choropleth2$get_x_scale()


Choropleth2$get_y_scale()

get_y_scale

Usage

Choropleth2$get_y_scale()


Choropleth2$get_reference_map()

get_reference_map

Usage

Choropleth2$get_reference_map()


Choropleth2$get_choropleth_as_polygon()

get_choropleth_as_polygon

Usage

Choropleth2$get_choropleth_as_polygon(alpha)

Arguments

alpha

null


Choropleth2$render_with_reference_map()

render_with_reference_map

Usage

Choropleth2$render_with_reference_map(alpha = 0.5)

Arguments

alpha

null


Choropleth2$clip()

support e.g. users just viewing states on the west coast

Usage

Choropleth2$clip()


Choropleth2$discretize()

discretizing values means

Usage

Choropleth2$discretize()


Choropleth2$bind()

bind

Usage

Choropleth2$bind()


Choropleth2$prepare_map()

prepare_map

Usage

Choropleth2$prepare_map()


Choropleth2$get_scale()

get_scale

Usage

Choropleth2$get_scale()


Choropleth2$theme_clean()

theme_clean

Usage

Choropleth2$theme_clean()


Choropleth2$theme_inset()

theme_inset

Usage

Choropleth2$theme_inset()


Choropleth2$format_levels()

format_levels

Usage

Choropleth2$format_levels(x, nsep = " to ")

Arguments

x

null

nsep

null


Choropleth2$set_zoom()

set_zoom

Usage

Choropleth2$set_zoom(zoom)

Arguments

zoom

null


Choropleth2$get_zoom()

get_zoom

Usage

Choropleth2$get_zoom()


Choropleth2$set_num_colors()

set_num_colors

Usage

Choropleth2$set_num_colors(num_colors)

Arguments

num_colors

null


Choropleth2$clone()

The objects of this class are cloneable with this method.

Usage

Choropleth2$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.