这是indexloc提供的服务,不要输入任何密码
Skip to content

update README #1051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ knitr::knit_hooks$set(output = function(x, options) {
[![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://cranchecks.info/badges/worst/tmap)](https://cran.r-project.org/web/checks/check_results_tmap.html)
[![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)
Expand All @@ -53,20 +53,29 @@ knitr::knit_hooks$set(output = function(x, options) {

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

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

The old version of **tmap** (version 3) is available in the [CRAN archive](https://cran.r-project.org/src/contrib/Archive/tmap/),
but we recommend moving to the new version 4.

### Development version

The development version can be installed from the GitHub repository using
`remotes` and `pak` packages or from the [R-universe repository](https://r-tmap.r-universe.dev/tmap).

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

# On Linux, with pak
# 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"))
```

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

**Windows**
Expand All @@ -87,7 +96,7 @@ 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}
```{r fig.height=3.5, message=FALSE}
tm_shape(World) +
tm_polygons(fill = "HPI")
```
Expand Down
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
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://cranchecks.info/badges/worst/tmap)](https://cran.r-project.org/web/checks/check_results_tmap.html)
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)
Expand All @@ -25,22 +25,31 @@ R-library for drawing charts.

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

``` r
install.packages("tmap")
```

The old version of **tmap** (version 3) is available in the [CRAN
archive](https://cran.r-project.org/src/contrib/Archive/tmap/), but we
recommend moving to the new version 4.

### Development version

The development version can be installed from the GitHub repository
using `remotes` and `pak` packages or from the [R-universe
repository](https://r-tmap.r-universe.dev/tmap).

``` r
# install.packages("remotes")
remotes::install_github("r-tmap/tmap")

# On Linux, with pak
# 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"))
```

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 @@ -64,11 +73,9 @@ Plot a World map of the happy planet index (HPI) per country. The object
``` r
tm_shape(World) +
tm_polygons(fill = "HPI")
#> [tip] Consider a suitable map projection, e.g. by adding `+ tm_crs("auto")`.
#> This message is displayed once per session.
```

<img src="man/figures/README-unnamed-chunk-3-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-4-1.png" width="100%" />

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

Expand All @@ -82,7 +89,7 @@ tm_shape(World, crs = "+proj=robin") +
)
```

<img src="man/figures/README-unnamed-chunk-4-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-5-1.png" width="100%" />

## Additional Resources for Learning **tmap**

Expand Down
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.
Binary file modified man/figures/README-unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading