choropleth_ggplot2: Map object of class sf using ggplot2

Description Usage Arguments Value Author(s) Examples

View source: R/map_ggplot2.R

Description

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

Usage

1
2
3
4
5
6
7
8
9
choropleth_ggplot2(
  sf_object,
  value = output,
  n = 7,
  dig.lab = 2,
  legend_title = "Class",
  option = "D",
  direction = 1
)

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

option

a character string indicating the colormap option to use. Four options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), "viridis" (or "D", the default option) and "cividis" (or "E").

direction

Sets the order of colors in the scale. If 1, the default, colors are ordered from darkest to lightest. If -1, the order of colors is reversed.

Value

ggplot map

Author(s)

Martin Haringa

Examples

1
2

Example output

sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
80 points fall not within a polygon.

spatialrisk documentation built on May 27, 2021, 1:06 a.m.