- Notifications
You must be signed in to change notification settings - Fork124
R package for thematic maps
License
r-tmap/tmap
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
tmap is an R package for drawing thematic maps. The API is based onA Layered Grammar ofGraphics andresembles the syntax ofggplot2, a popularR-library for drawing charts.
Installation oftmap is straightforward:
install.packages("tmap")In case it fails, please check the dependencies below.
The development version can be installed from the GitHub repositoryusing one of the following functions:
# install.packages("remotes")remotes::install_github("r-tmap/tmap")# install.packages("pak")pak::pak("r-tmap/tmap")# Or from r-universeinstall.packages("tmap",repos= c("https://r-tmap.r-universe.dev","https://cloud.r-project.org"))
tmap depend on other R packages, which will automatically be installedalong. However, two packagessf ands2 have additional systemrequirements: for Windows users, these are also installed along. ForLinux and MacOS users, these additional libraries may need to beinstalled manually.
Instructions for the libraries GEOS, GDAL and PROJ (required bysf):see the installation instructions ofterra which requires the samelibraries:MacOSandLinux
Instructions for the libraries Abseil and OpenSSL (required bys2):see theinstallationinstructions.
Plot a World map of the happy planet index (HPI) per country. The objectWorld is an example spatial data (sf) object that is contained intmap:
tm_shape(World)+ tm_polygons(fill="HPI")
This map can be enhanced in several ways. For instance:
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) )
3-6 June, organized jointly byPRStatsandInstats
For more in-depth learning on thetmap package, refer to thefollowing resources:
- Book Chapter:Geocomputation with Rincludes a chapter onMaking Maps withR, which coverstmap.
- Official Vignettes: A collection of vignettes atr-tmap.github.io coversboth basic and advanced topics with examples.
- Work-in-Progress Book:Elegant and Informative Maps with tmap isan upcoming book available attmap.geocompx.org.
These resources provide a solid foundation for working withtmap inR.
About
R package for thematic maps
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.


