tmap: thematic maps in R
tmap
is an actively maintained open-source R-library for drawing thematic maps, written by Martijn Tennekes. The API is based on A Layered Grammar of Graphics by Hadley Wickham and resembles the syntax of ggplot2
, a popular R-library for drawing charts.
Installation
tmap
is available on CRAN. The latest version is 1.8-1 (2017-01-29).
The tmap
packages relies on the R packages rgdal
and rgeos
, which depend on the external libraries gdal
, proj.4
and geos
. On Windows, these are embedded in rgdal
and rgeos
. On Linux (Ubuntu), these libraries can be installed as follows:
sudo apt-get install libgdal-dev
sudo apt-get install libproj-dev
sudo apt-get install libgeos-dev
See source pages for gdal, proj, and geos. For Mac OS users, see http://www.kyngchaos.com.
Also, tmap
relies indirectly on the R package V8
. For Linux (Ubuntu), the v8
library needs to be installed for this:
sudo apt-get install libv8-dev
Development
Odd numbered versions will be development versions and even numbered versions stable CRAN releases (as with data.table).
The latest development version can be installed using devtools
. In the latest development version, non-plotting functions have been migrated to tmaptools.
library(devtools)
install_github("mtennekes/tmaptools")
install_github("mtennekes/tmap")
See NEWS for the latest features and improvements and the issue list for discussions of enhancements and bugs.
Do you want to help with the development of the package? Please let me know! Any feedback, requests, tips, or bug reports are welcome!
Usage
library(tmap)
Vignettes, Demos, and Examples
tmap modes: plot and interactive view
Presentation
tmap: creating thematic maps in a flexible way
Other resources
- Tutorial Creating maps in R
- Blog post StatialControl
- Blog post TWIAV
- Computer World: Create maps in R in 10 (fairly) easy steps
- Tutorial Visualising spatial data: from base to shiny - workshop
- Stack Overflow questions (#tmap)
Getting help
There are two main places to get help with ggplot2:
- stackoverflow is a great source of answers to common tmap questions. It is also a great place to get help, once you have created a reproducible example that illustrates your problem. Please tag your questions with tmap.
- If you have a request or if think your problem is caused by a bug, please open an issue, preferably with are reproducible example.