cartogram

Build Status CRAN Downloads

Create Cartograms with R

Construct a continuous area cartogram by a rubber sheet distortion algorithm (Dougenik et al. 1985) or non-contiguous Area Cartograms (Olson 1976) in R.

Changes

Example Continuous Area Cartogram

library(cartogram)
library(tmap)
library(maptools)

data(wrld_simpl)

afr <- wrld_simpl[wrld_simpl$REGION==2,]
afr <- spTransform(afr, CRS("+init=epsg:3395"))

# construct cartogram
afrc <- cartogram(afr, "POP2005", itermax=5)

# plot it
tm_shape(afrc) + tm_fill("POP2005", style="jenks") + 
  tm_borders() + tm_layout(frame=F)
Cartogram

Cartogram

Example Non-contiguous Area Cartogram

Many thanks to @rCarto and @neocarto for contributing the code!

library(cartogram)
library(tmap)
library(maptools)

data(wrld_simpl)

afr <- wrld_simpl[wrld_simpl$REGION==2,]
afr <- spTransform(afr, CRS("+init=epsg:3395"))

# construct cartogram
afrnc <- nc_cartogram(afr, "POP2005")

# plot it
tm_shape(afr) + tm_borders() + 
  tm_shape(afrnc) + tm_fill("POP2005", style="jenks") + 
  tm_borders() + tm_layout(frame=F)
Cartogram Olson

Cartogram Olson

References