Learn R Programming

spatialrisk (version 0.6.0)

choropleth_tmap: Map object of class sf using tmap

Description

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

Usage

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

Arguments

sf_object

object of class sf

value

column name to shade the polygons

id_name

column name of ids to plot

mode

choose between static ('plot' is default) and interactive map ('view')

legend_title

title of legend

bgcolor

background color (default is "gray")

Value

ggplot map

Examples

Run this code
# NOT RUN {
test <- choropleth_sf(nl_provincie, insurance, sum(amount, na.rm = TRUE))
choropleth_tmap(test)
choropleth_tmap(test, id_name = "province_name", mode = "view")
# }

Run the code above in your browser using DataLab