Description
Continuous Cartogram.
Description
Procedures for making continuous cartogram. Procedures available are: flow based cartogram (Gastner & Newman (2004) <doi:10.1073/pnas.0400280101>), fast flow based cartogram (Gastner, Seguy & More (2018) <doi:10.1073/pnas.1712674115>), rubber band based cartogram (Dougenik et al. (1985) <doi:10.1111/j.0033-0124.1985.00075.x>).
README.md
Installation
Install cartogramR from CRAN with:
install.packages("cartogramR")
For windows users, the CRAN distributes a compiled package and there is no need to install it from source. If you install package from sources, you will need FFTW. This library is fairly common thus a package for it is usually available (linux: see fftw-devel (rpm), fftw-dev (deb); Mac OS X: fftw (brew)).
Usage
For example cartogram for the number of electors in the USA in 1964:
Load package, data and verify that at least one grid point fall in each region (the smallest region is Washington DC)
library(cartogramR) data(usa) plot(precartogramR(usa))
The default grid size $L=512$ is OK, thus we can run the cartogram for variable
electors64
and plot the cartogram:carto <- cartogramR(usa, "electors64") plot(carto)
Acknowledgements
- Many many thanks to Michael T. Gastner for his flow based cartogram programs on which cartogramR is (heavily) based
- Timothée GIRAUD UMS 2414 RIATE / CNRS Paris, for suggestions and careful reading.