Spatial Data Visualization with tmap
A Practical Guide to Thematic Mapping in R
Welcome
A practical guide to creating clear, effective maps in R with the tmap package.
Welcome to the online home of Spatial Data Visualization with tmap: A Practical Guide to Thematic Mapping in R. This book is a hands-on, open-source resource for anyone interested in creating maps using R and the tmap package.
Whether you’re a beginner in geospatial analysis or an experienced GIS user transitioning to R, this book will help you learn how to visualize spatial data for print, the web, and interactive applications.
What you’ll learn
This book walks you through the full process of thematic mapping with tmap, including:
- Load, explore, and prepare spatial data in R
- Build maps using tmap’s core components like shapes, layers, and visual variables
- Customize map appearance with legends, scales, layouts, and annotations
- Create faceted, animated, and interactive maps for various audiences
- Integrate tmap maps into reports, web apps, and Shiny dashboards
- Extend tmap by adding new map layer types, spatial data classes, and output modes
- Apply good design practices to make maps that are clear, consistent, and effective
Each chapter combines concise explanations, reproducible code, and real-world examples.
How to contribute
We welcome your contributions to make this book better!
You can help by:
- Suggesting topics or reporting issues via the issue tracker
- Fixing typos or improving clarity
- Enhancing code examples or adding new ones
To contribute:
- Visit the GitHub repository
- Fork the project and create a branch
- Make your changes
- Open a pull request with a short description of your contribution
All contributions are appreciated and acknowledged.
Citation
If you use this book in your work, please cite it as:
Tennekes M., Nowosad J. (2025) Spatial Data Visualization with tmap: A Practical Guide to Thematic Mapping in R. Available at: https://tmap.geocompx.org
License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 4.0 International License.
The code samples in this book are licensed under a Creative Commons CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
This version of the book was built on 2025-07-01.