Learn R Programming

spatialrisk (version 0.6.0)

choropleth_ggplot2: Map object of class sf using ggplot2

Description

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

Usage

choropleth_ggplot2(sf_object, value = output, n = 7, dig.lab = 2,
  legend_title = "Class")

Arguments

sf_object

object of class sf

value

column to shade the polygons

n

number of clusters (default is 7)

dig.lab

number of digits in legend (default is 2)

legend_title

title of legend

Value

ggplot map

Examples

Run this code
# NOT RUN {
test <- choropleth_sf(nl_postcode2, insurance, sum(amount, na.rm = TRUE))
choropleth_ggplot2(test)
# }

Run the code above in your browser using DataLab