cartogram: Cartogram

Description Usage Arguments Value See Also Examples

Description

Make a cartogram, that is, a map where the area of polygons is made proportional to another variable. This can be a good way to map raw count data (e.g. votes).

Usage

1
2
## S4 method for signature 'SpatVector'
cartogram(x, var, type)

Arguments

x

SpatVector

var

character. A variable name in x

type

character. Cartogram type, only "nc" (non-contiguous) is currently supported

Value

SpatVector

See Also

plot, rescale

Examples

1
2
3
4
5
6
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
v$value <- 1:12
p <- cartogram(v, "value", "nc")
plot(v, col="light gray", border="gray")
lines(p, col="red", lwd=2)

terra documentation built on Oct. 11, 2021, 9:09 a.m.