{"id":13858426,"url":"https://github.com/r-tmap/tmap","last_synced_at":"2025-10-04T23:26:20.806Z","repository":{"id":12094056,"uuid":"14682434","full_name":"r-tmap/tmap","owner":"r-tmap","description":"R package for thematic maps","archived":false,"fork":false,"pushed_at":"2025-04-26T19:31:13.000Z","size":828972,"stargazers_count":881,"open_issues_count":63,"forks_count":124,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-28T04:35:28.250Z","etag":null,"topics":["choropleth-maps","maps","r","spatial","thematic-maps","visualisation"],"latest_commit_sha":null,"homepage":"https://r-tmap.github.io/tmap","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hawaiianchimp/ESCan","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-tmap.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-11-25T10:16:24.000Z","updated_at":"2025-04-26T19:18:34.000Z","dependencies_parsed_at":"2023-09-22T17:05:32.813Z","dependency_job_id":"3a6aeb4f-de38-40bb-a9f9-cb676f6f3ff3","html_url":"https://github.com/r-tmap/tmap","commit_stats":{"total_commits":1714,"total_committers":32,"mean_commits":53.5625,"dds":"0.10851808634772464","last_synced_commit":"7dd4673636067a3eadb58ab0db519f4630a90c71"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-tmap%2Ftmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-tmap%2Ftmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-tmap%2Ftmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-tmap%2Ftmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-tmap","download_url":"https://codeload.github.com/r-tmap/tmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326511,"owners_count":21571628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["choropleth-maps","maps","r","spatial","thematic-maps","visualisation"],"created_at":"2024-08-05T03:02:08.289Z","updated_at":"2025-10-04T23:26:20.800Z","avatar_url":"https://github.com/r-tmap.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\neditor_options: \n  chunk_output_type: console\n---\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  out.width = \"100%\",\n  dpi = 300,\n  fig.width = 7.2916667,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\nhook_output \u003c- knitr::knit_hooks$get(\"output\")\nknitr::knit_hooks$set(output = function(x, options) {\n   lines \u003c- options$output.lines\n   if (is.null(lines)) {\n     return(hook_output(x, options))  # pass to default hook\n   }\n   x \u003c- unlist(strsplit(x, \"\\n\"))\n   more \u003c- \"...\"\n   if (length(lines)==1) {        # first n lines\n     if (length(x) \u003e lines) {\n       # truncate the output, but add ....\n       x \u003c- c(head(x, lines), more)\n     }\n   } else {\n     x \u003c- c(more, x[lines], more)\n   }\n   # paste these lines together\n   x \u003c- paste(c(x, \"\"), collapse = \"\\n\")\n   hook_output(x, options)\n })\n```\n\n# tmap: thematic maps in R \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"139\" alt=\"\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![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)\n[![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)\n[![CRAN](https://www.r-pkg.org/badges/version/tmap)](https://cran.r-project.org/package=tmap) \n[![CRAN checks](https://badges.cranchecks.info/worst/tmap.svg)](https://cran.r-project.org/web/checks/check_results_tmap.html)\n[![Downloads](https://cranlogs.r-pkg.org/badges/tmap?color=brightgreen)](https://www.r-pkg.org:443/pkg/tmap)\n[![License](https://img.shields.io/badge/License-GPL%20v3-brightgreen.svg?style=flat)](https://www.gnu.org/licenses/gpl-3.0.html)\n[![r-universe](https://r-tmap.r-universe.dev/badges/tmap)](https://r-tmap.r-universe.dev/tmap)\n\u003c!-- badges: end --\u003e\n\n**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.\n\n## Installation\n\nInstallation of **tmap** is straightforward:\n\n```{r eval=FALSE}\ninstall.packages(\"tmap\")\n```\n\nIn case it fails, please check the dependencies below.\n\n### Development version\n\nThe development version can be installed from the GitHub repository using one of the following functions:\n\n```{r eval=FALSE}\n# install.packages(\"remotes\")\nremotes::install_github(\"r-tmap/tmap\")\n\n# install.packages(\"pak\")\npak::pak(\"r-tmap/tmap\")\n\n# Or from r-universe\ninstall.packages(\"tmap\", repos = c(\"https://r-tmap.r-universe.dev\", \"https://cloud.r-project.org\"))\n```\n\n## Dependencies\n\ntmap 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.\n\nInstructions 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)\n\nInstructions for the libraries Abseil and OpenSS (required by **s2**): see the [installation instructions](https://r-spatial.github.io/s2/#installation).\n\n## Getting started\n\n```{r echo=FALSE, message=FALSE} \nlibrary(tmap)\n```\n\nPlot a World map of the happy planet index (HPI) per country.\nThe object `World` is an example spatial data (`sf`) object that is contained in **tmap**:\n\n```{r fig.height=3.5, message=FALSE}\ntm_shape(World) +\n\ttm_polygons(fill = \"HPI\")\n```\n\nThis map can be enhanced in several ways. \nFor instance:\n\n```{r fig.height=4.5}\ntm_shape(World, crs = \"+proj=robin\") +\n\ttm_polygons(fill = \"HPI\",\n\t\t\t\tfill.scale = tm_scale_continuous(values = \"matplotlib.rd_yl_bu\"),\n\t\t\t\tfill.legend = tm_legend(title = \"Happy Planet Index\",\n\t\t\t\t\t\t\t\t\t\torientation = \"landscape\", \n\t\t\t\t\t\t\t\t\t\tframe = FALSE)\n\t\t\t\t)\n```\n\n\u003c!--\n## Online tmap course\n\n3-6 June, organized jointly by [PRStats](https://www.prstats.org/course/visual-exploration-analysis-and-presentation-of-spatial-data-using-the-tmap-package-tmap01/) and [Instats](https://instats.org/seminar/spatial-data-analysis-and-visualization)\n--\u003e\n\n## Additional Resources for Learning **tmap**\n\nFor more in-depth learning on the **tmap** package, refer to the following resources:  \n\n- **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**.  \n- **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.  \n- **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/).  \n\nThese resources provide a solid foundation for working with **tmap** in R.\n\n[3]: https://cran.r-project.org/package=ggplot2\n[4]: https://vita.had.co.nz/papers/layered-grammar.pdf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-tmap%2Ftmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-tmap%2Ftmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-tmap%2Ftmap/lists"}