Compute the Rectangular Statistical Cartogram

Provides an interface and a C++ implementation of the RecMap MP2 construction heuristic (see 'citation("recmap")' for details). This algorithm draws maps according to a given statistical value (e.g., election results, population or epidemiological data). The basic idea of the RecMap algorithm is that each map region (e.g., different countries) is represented by a rectangle. The area of each rectangle represents the statistical value given as input (maintain zero cartographic error). Documentation about RecMap is provided by a vignette included in this package.


CRAN_Status_Badge Research software impact Build Status

This package implementats of the RecMap construction algorithm (MP2).

Installation

from CRAN

recmap requires R 3.3 or later.

Released and tested versions of recmap are available via CRAN, and can be installed using the following code

install.packages('recmap')

from github

the code below installs the latest development version

install.packages('devtools')
library(devtools)
install_github('cpanse/recmap', build_vignettes = TRUE, quiet = FALSE)
browseVignettes('recmap')

Use the docker public | automated build recmap image

this image contains the latest build.

docker pull cpanse/recmap \
&& docker run -d -p 8791:8787 cpanse/recmap

connect to http://yourdockerhost:8791 using a web browser

  • username: rstudio
  • password: rstudio

or stand alone

docker run -it -p 8787:8787 cpanse/recmap R -e "library(shiny); recmap_shiny <- system.file('shiny-examples', package = 'recmap'); shiny::runApp(recmap_shiny, display.mode = 'normal', port=8787, host='0.0.0.0')"

connect to the docker host:8787

Documentation

The package ships with a package vignette (browseVignettes('recmap')) and a reference manual (just type ?recmap on the R shell). Both documents are also available on the package's CRAN page. A white paper containing more technical information and examples is available through jss.v086.c01.

Demonstration

animation of the construction algorithm

animated GIF of the construction algorithm

interactive shiny application

# Requires to install suggested  packages
pkgs <- c('colorspace', 'maps', 'noncensus', 'shiny')
pkgs <- pkgs[(!pkgs %in% unique(installed.packages()[,'Package']))]
if(length(pkgs) > 0){install.packages(pkgs)}
 
library(shiny)
recmap_shiny <- system.file('shiny-examples', package = 'recmap')
shiny::runApp(recmap_shiny, display.mode = 'normal')

Related approaches

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("recmap")

1.0.0 by Christian Panse, 5 months ago


Report a bug at https://github.com/cpanse/recmap/issues


Browse source code at https://github.com/cran/recmap


Authors: Christian Panse [aut, cre]


Documentation:   PDF Manual  


Task views: Analysis of Spatial Data


GPL-3 license


Depends on GA, Rcpp, sp

Suggests colorspace, doParallel, knitr, lattice, maps, noncensus, shiny, testthat, tufte, xtable

Linking to Rcpp

System requirements: C++11


See at CRAN