Skip to content

Commit

Permalink
updates readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowosad committed Nov 13, 2024
1 parent 6194069 commit a5dad12
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
23 changes: 11 additions & 12 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,11 @@ knitr::knit_hooks$set(output = function(x, options) {
[![r-universe](https://r-tmap.r-universe.dev/badges/tmap)](https://r-tmap.r-universe.dev/tmap)
<!-- badges: end -->




**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.

**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 (version 4) is straightforward:

Installation of **tmap** (version 4) is straightforward:

```{r eval=FALSE}
# install.packages("remotes")
Expand All @@ -68,7 +63,7 @@ pak::pak("r-tmap/tmap")
install.packages("tmap", repos = c("https://r-tmap.r-universe.dev", "https://cloud.r-project.org"))
```

The old version of `tmap` (version 3) is available on [![CRAN](https://www.r-pkg.org/badges/version/tmap)](https://cran.r-project.org/package=tmap), but we recommend to use version 4, which will be on CRAN soon.
The old version of **tmap** (version 3) is available on [![CRAN](https://www.r-pkg.org/badges/version/tmap)](https://cran.r-project.org/package=tmap), but we recommend to use version 4, which will be on CRAN soon.

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).

Expand All @@ -87,15 +82,16 @@ See https://www.kyngchaos.com/. Please address installation issues in this [issu
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`:
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, fig.width=8}
tm_shape(World) +
tm_polygons(fill = "HPI")
```

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

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

```{r}
tm_shape(World, crs = "+proj=robin") +
Expand All @@ -109,5 +105,8 @@ tm_shape(World, crs = "+proj=robin") +

# Book chapter about tmap

The book [Geocomputation with R](https://r.geocompx.org/) provides a chapter on [Making maps with R](https://r.geocompx.org/adv-map), including a section on **tmap**.


https://r.geocompx.org/adv-map
[3]: https://cran.r-project.org/package=ggplot2
[4]: https://vita.had.co.nz/papers/layered-grammar.pdf
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ checks](https://cranchecks.info/badges/worst/tmap)](https://cran.r-project.org/w
<!-- badges: end -->

**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.
[*A Layered Grammar of
Graphics*](https://vita.had.co.nz/papers/layered-grammar.pdf) and
resembles the syntax of
[**ggplot2**](https://cran.r-project.org/package=ggplot2), a popular
R-library for drawing charts.

## Installation

Installation of tmap (version 4) is straightforward:
Installation of **tmap** (version 4) is straightforward:

``` r
# install.packages("remotes")
Expand All @@ -34,7 +37,7 @@ pak::pak("r-tmap/tmap")
install.packages("tmap", repos = c("https://r-tmap.r-universe.dev", "https://cloud.r-project.org"))
```

The old version of `tmap` (version 3) is available on
The old version of **tmap** (version 3) is available on
[![CRAN](https://www.r-pkg.org/badges/version/tmap)](https://cran.r-project.org/package=tmap),
but we recommend to use version 4, which will be on CRAN soon.

Expand All @@ -56,7 +59,7 @@ issues in this [issue](https://github.com/r-tmap/tmap/issues/149).

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`:
**tmap**:

``` r
tm_shape(World) +
Expand All @@ -81,4 +84,6 @@ tm_shape(World, crs = "+proj=robin") +

# Book chapter about tmap

<https://r.geocompx.org/adv-map>
The book [Geocomputation with R](https://r.geocompx.org/) provides a
chapter on [Making maps with R](https://r.geocompx.org/adv-map),
including a section on **tmap**.
Binary file modified man/figures/README-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a5dad12

Please sign in to comment.