tmap

R package for thematic maps

https://github.com/r-tmap/tmap

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 36 committers (5.6%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (20.0%) to scientific vocabulary

Keywords

choropleth-maps maps r spatial thematic-maps visualisation

Keywords from Contributors

geos gdal proj geospatial-data rspatial book simple-features mapping-tools geography geocomputation
Last synced: 6 months ago · JSON representation

Repository

R package for thematic maps

Basic Info
Statistics
  • Stars: 889
  • Watchers: 25
  • Forks: 125
  • Open Issues: 55
  • Releases: 2
Topics
choropleth-maps maps r spatial thematic-maps visualisation
Created about 12 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
editor_options: 
  chunk_output_type: console
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  out.width = "100%",
  dpi = 300,
  fig.width = 7.2916667,
  comment = "#>",
  fig.path = "man/figures/README-"
)
hook_output <- knitr::knit_hooks$get("output")
knitr::knit_hooks$set(output = function(x, options) {
   lines <- options$output.lines
   if (is.null(lines)) {
     return(hook_output(x, options))  # pass to default hook
   }
   x <- unlist(strsplit(x, "\n"))
   more <- "..."
   if (length(lines)==1) {        # first n lines
     if (length(x) > lines) {
       # truncate the output, but add ....
       x <- c(head(x, lines), more)
     }
   } else {
     x <- c(more, x[lines], more)
   }
   # paste these lines together
   x <- paste(c(x, ""), collapse = "\n")
   hook_output(x, options)
 })
```

# tmap: thematic maps in R 


[![R-CMD-check](https://github.com/r-tmap/tmap/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-tmap/tmap/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/r-tmap/tmap/branch/master/graph/badge.svg)](https://app.codecov.io/gh/r-tmap/tmap?branch=master)
[![CRAN](https://www.r-pkg.org/badges/version/tmap)](https://cran.r-project.org/package=tmap) 
[![CRAN checks](https://badges.cranchecks.info/worst/tmap.svg)](https://cran.r-project.org/web/checks/check_results_tmap.html)
[![Downloads](https://cranlogs.r-pkg.org/badges/tmap?color=brightgreen)](https://www.r-pkg.org:443/pkg/tmap)
[![License](https://img.shields.io/badge/License-GPL%20v3-brightgreen.svg?style=flat)](https://www.gnu.org/licenses/gpl-3.0.html)
[![r-universe](https://r-tmap.r-universe.dev/badges/tmap)](https://r-tmap.r-universe.dev/tmap)


**tmap** is an R package for drawing thematic maps. The API is based on [*A Layered Grammar of Graphics*][4] and resembles the syntax of [**ggplot2**][3], a popular R-library for drawing charts.

## Installation

Installation of **tmap** is straightforward:

```{r eval=FALSE}
install.packages("tmap")
```

In case it fails, please check the dependencies below.

### Development version

The development version can be installed from the GitHub repository using one of the following functions:

```{r eval=FALSE}
# install.packages("remotes")
remotes::install_github("r-tmap/tmap")

# install.packages("pak")
pak::pak("r-tmap/tmap")

# Or from r-universe
install.packages("tmap", repos = c("https://r-tmap.r-universe.dev", "https://cloud.r-project.org"))
```

## Dependencies

tmap depend on other R packages, which will automatically be installed along. However, two packages **sf** and **s2** have additional system requirements: for Windows users, these are also installed along. For Linux and MacOS users, these additional libraries may need to be installed manually.

Instructions for the libraries GEOS, GDAL and PROJ (required by **sf**): see the installation instructions of **terra** which requires the same libraries: [MacOS](https://rspatial.github.io/terra/index.html?q=installation#macos) and [Linux](https://rspatial.github.io/terra/index.html?q=installation#linux)

Instructions for the libraries Abseil and OpenSS (required by **s2**): see the [installation instructions](https://r-spatial.github.io/s2/#installation).

## Getting started

```{r echo=FALSE, message=FALSE} 
library(tmap)
```

Plot a World map of the happy planet index (HPI) per country.
The object `World` is an example spatial data (`sf`) object that is contained in **tmap**:

```{r fig.height=3.5, message=FALSE}
tm_shape(World) +
	tm_polygons(fill = "HPI")
```

This map can be enhanced in several ways. 
For instance:

```{r fig.height=4.5}
tm_shape(World, crs = "+proj=robin") +
	tm_polygons(fill = "HPI",
				fill.scale = tm_scale_continuous(values = "matplotlib.rd_yl_bu"),
				fill.legend = tm_legend(title = "Happy Planet Index",
										orientation = "landscape", 
										frame = FALSE)
				)
```



## Additional Resources for Learning **tmap**

For more in-depth learning on the **tmap** package, refer to the following resources:  

- **Book Chapter:** [Geocomputation with R](https://r.geocompx.org/) includes a chapter on [Making Maps with R](https://r.geocompx.org/adv-map), which covers **tmap**.  
- **Official Vignettes:** A collection of vignettes at [r-tmap.github.io](https://r-tmap.github.io/tmap/articles/) covers both basic and advanced topics with examples.  
- **Work-in-Progress Book:** *Spatial Data Visualization with tmap: A Practical Guide to Thematic Mapping in R* is an upcoming book available at [tmap.geocompx.org](https://tmap.geocompx.org/).  

These resources provide a solid foundation for working with **tmap** in R.

[3]: https://cran.r-project.org/package=ggplot2
[4]: https://vita.had.co.nz/papers/layered-grammar.pdf

Owner

  • Name: r-tmap
  • Login: r-tmap
  • Kind: organization

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 2,308
  • Total Committers: 36
  • Avg Commits per committer: 64.111
  • Development Distribution Score (DDS): 0.143
Past Year
  • Commits: 474
  • Committers: 8
  • Avg Commits per committer: 59.25
  • Development Distribution Score (DDS): 0.222
Top Committers
Name Email Commits
mtennekes m****s@g****m 1,977
olivroy o****1@h****m 179
Jakub Nowosad t****i@g****m 71
timelyportfolio k****l@t****m 14
robinlovelace r****x@g****m 13
Nick Bearman n****k@g****k 5
Krzysztof Dyba 3****b 4
Joel Gombin j****n@g****m 4
Andrés Esteban Duhour a****s@s****y 4
Pukar Bhandari p****i@o****m 3
Sebastian Jeworutzki s****i@r****e 3
John Clouse j****e@g****m 2
Matthieu M****r@g****m 2
Edzer Pebesma e****a@u****e 2
Paul Murrell p****l@s****z 2
kbrevoort k****n@b****m 2
rlzijdeman r****n@i****l 2
promerpr 6****r 1
mpadge m****m@e****m 1
Nathan Doyle N****e@a****e 1
Nehemie n****r@e****r 1
colin c****n@t****r 1
Will Beasley w****y@h****m 1
Stéphane Guillou s****u@m****g 1
Phil Mike Jones p****s 1
Nanu Frechen m****l@n****e 1
Jérôme Guélat 1****t 1
Jannes Muenchow m****a@g****e 1
IvanPalm i****i@g****m 1
Diego H d****o@g****m 1
and 6 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 495
  • Total pull requests: 115
  • Average time to close issues: 8 months
  • Average time to close pull requests: 2 days
  • Total issue authors: 167
  • Total pull request authors: 13
  • Average comments per issue: 3.54
  • Average comments per pull request: 0.71
  • Merged pull requests: 103
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 204
  • Pull requests: 47
  • Average time to close issues: 11 days
  • Average time to close pull requests: about 9 hours
  • Issue authors: 68
  • Pull request authors: 8
  • Average comments per issue: 3.13
  • Average comments per pull request: 0.81
  • Merged pull requests: 42
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Nowosad (92)
  • mtennekes (85)
  • olivroy (28)
  • Robinlovelace (17)
  • marine-ecologist (14)
  • ar-puuk (9)
  • Rapsodia86 (7)
  • jguelat (7)
  • xiaofanliang (6)
  • DOSull (5)
  • see24 (5)
  • gilbertocamara (5)
  • MatthieuStigler (5)
  • aonojeghuo (4)
  • barryrowlingson (4)
Pull Request Authors
  • olivroy (60)
  • Nowosad (20)
  • nickbearman (7)
  • ar-puuk (6)
  • Robinlovelace (4)
  • jguelat (4)
  • kadyb (4)
  • stragu (3)
  • johnbaums (2)
  • aduhour (2)
  • wibeasley (1)
  • MatthieuStigler (1)
  • BeansIsFat (1)
Top Labels
Issue Labels
bug (77) tmap_v4 (64) enhancement (39) question (25) Layout (16) compat (15) View-mode (13) help wanted (10) Legends (10) Help wanted (6) Layers (5) Plot-mode (4) view (4) Text (4) Scales (4) Finetuning (4) Internals (3) publicity (3) sticky (2) Question (2) major (2) finetuning (2) Docs (1) Publicity (1) Shiny (1) Chart (1) review (1) Colors (1) tmap_v3 (1) for_developers (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 22,453 last-month
  • Total docker downloads: 1,012,264
  • Total dependent packages: 59
  • Total dependent repositories: 158
  • Total versions: 31
  • Total maintainers: 1
cran.r-project.org: tmap

Thematic Maps

  • Versions: 31
  • Dependent Packages: 59
  • Dependent Repositories: 158
  • Downloads: 22,453 Last month
  • Docker Downloads: 1,012,264
Rankings
Docker downloads count: 0.0%
Stargazers count: 0.4%
Forks count: 0.5%
Average: 1.2%
Dependent packages count: 1.6%
Dependent repos count: 1.6%
Downloads: 3.1%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/pkgdown.yaml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc master composite
  • r-lib/actions/setup-r master composite
DESCRIPTION cran
  • R >= 3.5.0 depends
  • methods * depends
  • RColorBrewer * imports
  • abind * imports
  • classInt >= 0.4 imports
  • grid * imports
  • htmltools * imports
  • htmlwidgets * imports
  • leafem >= 0.1 imports
  • leaflet >= 2.0.2 imports
  • leafsync * imports
  • rlang * imports
  • sf >= 0.9 imports
  • stars >= 0.5 imports
  • stats * imports
  • tmaptools >= 3.1 imports
  • units >= 0.6 imports
  • utils * imports
  • viridisLite * imports
  • widgetframe * imports
  • av * suggests
  • cartogram * suggests
  • covr * suggests
  • dplyr * suggests
  • ggplot2 * suggests
  • gifski * suggests
  • knitr * suggests
  • osmdata * suggests
  • png * suggests
  • rmapshaper * suggests
  • rmarkdown * suggests
  • s2 * suggests
  • shiny * suggests
  • testthat * suggests
  • tidyr * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite