inst/doc/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: 1. Load package, data and verify that at least one grid point fall in each region (the smallest region is Washington DC)

r library(cartogramR) data(usa) plot(precartogramR(usa)) 2. The default grid size $L=512$ is OK, thus we can run the cartogram for variable electors64 and plot the cartogram: r carto <- cartogramR(usa, "electors64") plot(carto)

Acknowledgements



Try the cartogramR package in your browser

Any scripts or data that you put into this service are public.

cartogramR documentation built on Oct. 18, 2022, 5:08 p.m.