choropleth_tmap: Map simple feature object using tmap

Description Usage Arguments Value Author(s) Examples

View source: R/map_tmap.R

Description

Takes an object produced by choropleth_sf(), and creates the correspoding choropleth map.

Usage

1
2
choropleth_tmap(sf_object, value = "output", id_name = "id",
  mode = "plot", legend_title = "Clustering", bgcolor = "gray")

Arguments

sf_object

Simple features object. Note that shapefiles consist of more than one file, all with identical basename, which should reside in the same directory.

value

Column to shade the polygons.

id_name

Column of ids to plot.

mode

There are two options: 'plot' or 'view'. Mode 'view' gives an interactive map.

legend_title

Title of legend.

bgcolor

Background color. Default is "gray".

Value

ggplot map

Author(s)

Martin Haringa

Examples

1
2
3
test <- choropleth_sf(nl_provincie, insurance, sum(amount, na.rm = TRUE))
choropleth_tmap(test)
choropleth_tmap(test, id_name = "province_name", mode = "view")

MHaringa/nlmaps documentation built on May 19, 2019, 9:40 p.m.