Home

Awesome

tmap: thematic maps in R

<!--[![Build Status](https://travis-ci.org/mtennekes/tmap.png?branch=master)](https://travis-ci.org/mtennekes/tmap)--> <!--[![Coverage Status](https://img.shields.io/codecov/c/github/mtennekes/tmap/master.svg)](https://codecov.io/github/mtennekes/tmap?branch=master)-->

AppVeyor Build Status License CRAN cran checks Downloads

tmap is an actively maintained open-source R-library for drawing thematic maps. The API is based on A Layered Grammar of Graphics and resembles the syntax of ggplot2, a popular R-library for drawing charts.

<span> <img src="https://mtennekes.github.io/downloads/images/classic.png" alt="Classic World Map" height="125px"/> <img src="https://mtennekes.github.io/downloads/images/bubble.png" alt="Bubble Map" height="125px"/> <img src="https://mtennekes.github.io/downloads/images/view_metro4.jpg" alt="Bubble Map" height="125px"/> <img src="https://mtennekes.github.io/downloads/images/world_facets2.png" alt="World facets" height="125px"/> <img src="https://mtennekes.github.io/downloads/images/USchoro.png" alt="US Choropleth" height="125px"/> <img src="https://mtennekes.github.io/downloads/images/US_PR.jpg" alt="US Choropleth" height="125px"/> <img src="https://mtennekes.github.io/downloads/images/crimes3b.png" alt="London Crimes" height="125px"/> <img src="https://mtennekes.github.io/downloads/images/crimes4.png" alt="London Crimes" height="125px"/> <img src="https://mtennekes.github.io/downloads/images/crimes5.png" alt="London Crimes" height="125px"/> <img src="https://mtennekes.github.io/downloads/images/view_crimes2.JPG" alt="London Crimes" height="125px"/> </span>

See below the source code for these images.

Installation

tmap is available on CRAN. Installation is straightforward:

install.packages("tmap")

For Linux and macOS users who are new to working with spatial data in R, this may fail since additional (non-R) libraries are required (which are automatically installed for Windows users).

Windows No additional installation required.

Linux (Ubuntu) See https://geocompr.github.io/post/2020/installing-r-spatial-ubuntu/. Please address installation issues in this issue.

macOS See http://www.kyngchaos.com. Please address installation issues in this issue.

Development

The latest development version can be installed using devtools. In order to use the development version of tmap, it is recommended to use the development version of tmaptools as well:

library(remotes)
install_github("r-tmap/tmaptools")
install_github("r-tmap/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 us know! Any feedback, requests, tips, or bug reports are welcome!

Usage

library(tmap)

Book

Tennekes, M., Nowosad, J., Elegant and informative maps with tmap. Draft version, https://r-tmap.github.io/

Reference

Tennekes, M., 2018, tmap: Thematic Maps in R, Journal of Statistical Software, 84(6), 1-39

This paper has been written for tmap 1.11-2. See the reproducible code using tmap 2.x and 3.x.

Vignettes

tmap: get started!

tmap: what is changed in recent versions?

tmap v4: a sneak peak

Tutorials

tmap in RMarkdown

Presentations

Other resources

Getting help

There are two main places to get help with tmap:

  1. 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.
  2. If you have a request or if think your problem is caused by a bug, please open an issue, preferably with a reproducible example.