spikemap: Plot a Spike Map

Description Usage Arguments Details Examples

View source: R/spikemap.R

Description

Plot a layer of spikes on a map.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
spikemap(
  x,
  var,
  inches = 3,
  width = 0.02,
  fixmax,
  col = "white",
  border = "red",
  lwd = 0.5,
  legend.pos = "bottomleft",
  legend.title.txt = var,
  legend.title.cex = 0.8,
  legend.values.cex = 0.6,
  legend.values.rnd = 0,
  add = TRUE
)

Arguments

x

an sf object, a simple feature collection.

var

name of the numeric field in x to plot.

inches

size of the tallest spike, in inches.

width

width of the spike's base.

fixmax

value of the tallest spike (see Details).

col

filling color of the spikes.

border

border color of the spikes.

lwd

width of spikes borders.

legend.pos

position of the legend, "bottomright", or a vector of two coordinates in map units (c(x, y)). If legend.pos is "n" then the legend is not plotted.

legend.title.txt

title of the legend.

legend.title.cex

size of the legend title.

legend.values.cex

size of the values in the legend.

legend.values.rnd

number of decimal places of the values displayed in the legend.

add

whether to add the layer to an existing plot (TRUE) or not (FALSE).

Details

Two maps with the same inches and fixmax parameters will be comparable.

Examples

1
2
3
4
library(sf)
com <- st_read(system.file("gpkg/com.gpkg", package="spikemap"))
plot(st_geometry(com))
spikemap(x = com, var = "pop")

rCarto/spikemap documentation built on May 22, 2020, 7:43 a.m.