Calculate Non-Contiguous Cartogram Boundaries

Share:

Description

Construct a non-contiguous area cartogram (Olson 1976).

Usage

1
nc_cartogram(shp, weight, k = 1, inplace = T)

Arguments

shp

SpatialPolygonDataFrame

weight

Name of the weighting variable in shp

k

Factor expansion for the unit with the greater value

inplace

If TRUE, each polygon is modified in its original place, if FALSE multi-polygons are centered on their initial centroid.

Value

SpatialPolygonDataFrame with resized polygon boundaries

References

Olson, J. M. (1976), Noncontiguous Area Cartograms. The Professional Geographer, 28: 371–380. doi:10.1111/j.0033-0124.1976.00371.x

Examples

1
2
3
4
5
6
7
8
library(maptools)
library(cartogram)
library(rgdal)
data(wrld_simpl)
afr <- spTransform(wrld_simpl[wrld_simpl$REGION==2 & wrld_simpl$POP2005 > 0,],
                   CRS("+init=epsg:3395"))
plot(afr)
plot(nc_cartogram(afr, "POP2005"), add = TRUE, col = 'red')

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.