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

Fix some typos and URLs in the vignettes #1102

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
May 6, 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
4 changes: 2 additions & 2 deletions vignettes/basics_basemaps.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ By default, basemaps are only shown in `"view"` mode, so not in `"plot"` mode. B

## Plot mode

To enable a basemap in plot mode, the package [`maptiles`](https://github.com/riatelab/maptiles/) is required. When specified without arguments, the default basemap server is "Esri.WorldGrayCanvas". This can be changed, e.g. `"OpenTopoMap"`.
To enable a basemap in plot mode, the package [`maptiles`](https://github.com/riatelab/maptiles/) is required. When specified without arguments, the default basemap is "Esri.WorldGrayCanvas". This can be changed, e.g. `"OpenTopoMap"`.

```{r, fig.height = 3.5}
tm_shape(metro) +
Expand Down Expand Up @@ -113,7 +113,7 @@ tm_shape(metro) +
tm_basemap(NULL)
```

Now it is also possible to use different map projections (see [vignette](https://r-tmap.github.io/tmap/articles/12_foundations_crs)):
Now it is also possible to use different map projections (see [vignette](https://r-tmap.github.io/tmap/articles/foundations_crs)):

```{r}
tmap_mode("view")
Expand Down
4 changes: 2 additions & 2 deletions vignettes/basics_components.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Components are non-spatial parts of the plots:

## Title and credits

`tm_title()` and `tm_credits()` add text to the map in the form a title and a credits/attribution text respectively. The underlying function and all the options are the same, but the default value differ: titles are by default larger and placed above the map (outside the frame), while credits are place inside the frame at the bottom right.
`tm_title()` and `tm_credits()` add text to the map in the form a title and a credits/attribution text respectively. The underlying function and all the options are the same, but the default values differ: titles are by default larger and placed above the map (outside the frame), while credits are place inside the frame at the bottom right.


```{r, fig.height = 6}
Expand Down Expand Up @@ -98,4 +98,4 @@ tm_scalebar(position = c("right", "bottom"))

If the components should be placed tighter to the frame, use capital case instead; e.g. `c("LEFT", "BOTTOM") in stead of `c("left", "bottom")`.

There are much more options to position map componets via `tm_pos()`, see the [vignette about positions](https://r-tmap.github.io/tmap/articles/41_position)
There are much more options to position map componets via `tm_pos()`, see the [vignette about positions](https://r-tmap.github.io/tmap/articles/adv_positions)
12 changes: 6 additions & 6 deletions vignettes/basics_exporting.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ tmap_options(scale = 1)

## Static maps (plot mode)

Maps in plot mode van be exported in many formats including:
Maps in plot mode can be exported in many formats including:

**pixel based** png, jpg, bmp, tiff.

**vectorized** pdf, eps, svg, and
**vectorized** pdf, eps, svg.

The `width` and `height` are specified in either pixels or inches (you can don't need to specify the units).
The `width` and `height` are specified in either pixels or inches (you can but don't need to specify the units).

For the pixel based formats, the relation between pixels and inches are specified via the argument `dpi` (dots-per-inch).

Expand All @@ -83,19 +83,19 @@ Exporting maps is done via `tmap_save()`.
tmap_save(tm, filename = "world.png", width = 7, height = 4, dpi = 300)
```

Values of `width` and `height` less than 50 are considered inches, whereas greater than 50 pixels are considered pixels:
Values of `width` and `height` less than 50 are considered to be inches, whereas those greater than 50 pixels are considered to be pixels:

```{r}
tmap_save(tm, filename = "world.png", width = 2100, height = 1200, dpi = 300)
```

Therefore, both examples result in the exactly the same file:
Therefore, both examples result in exactly the same file:

```{r, echo = FALSE, fig.width = 7, fig.height = 4}
tm + tm_layout(scale = 1)
```

Vector based formats are preferred over pixel based, because of the scalability. In case pixel formats are used, please make to use a sufficient number of pixels. For **web publications** at least 144 dpi is required. This may seem overkill, but is required for *retina* (high point-per-inch) displaces. For **printing** 300 or even 600 dpi is required.
Vector based formats are preferred over pixel based, because of the scalability. In case pixel formats are used, please make sure to use a sufficient number of pixels. For **web publications** at least 144 dpi is required. This may seem overkill, but is required for *retina* (high point-per-inch) displays. For **printing** 300 or even 600 dpi is required.

### Aspect ratio

Expand Down
2 changes: 1 addition & 1 deletion vignettes/basics_facets.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ tm_shape(NLD_muni) +

## Facets: two or three dimensions

Facets can also be defined for two or three dimensions, obtained via `tm_facets_grid()` These three dimensions correspond to *rows*, *columns*, and *pages* respectively. The most common use case is two just dimensions, rows and columns.
Facets can also be defined for two or three dimensions, using `tm_facets_grid()`. These three dimensions correspond to *rows*, *columns*, and *pages* respectively. The most common use case is two just dimensions, rows and columns.
In that case, `tm_facets_grid()` is used.


Expand Down
4 changes: 2 additions & 2 deletions vignettes/basics_layout.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ With layout we mean all aspects of how the plot looks like, except for

* specifications of data-driven [visual variables](https://r-tmap.github.io/tmap/articles/basics_vv).
* the layout of [legends](https://r-tmap.github.io/tmap/articles/basics_legends#layout)
* the layout ovf [map components](https://r-tmap.github.io/tmap/articles/basics_components)
* the layout of [map components](https://r-tmap.github.io/tmap/articles/basics_components)

What is left? Background colors, frames, panels, fonts, margins, etc.

Expand Down Expand Up @@ -118,7 +118,7 @@ tm_layout(bg.color = "skyblue",

## Panels

To change the appearance of panels the options with the prefix `panel.` are usd:
To change the appearance of panels the options with the prefix `panel.` are used:

```{r, fig.height = 7}
tm_shape(World, crs = "+proj=eqearth") +
Expand Down
12 changes: 6 additions & 6 deletions vignettes/basics_modes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ tm_shape(metro) +
size.scale = tm_scale_continuous(values.scale = 0.8, n = 8))
```

We are in `"plot"` mode. Now we can plot the map by printing `tm` object:
We are in `"plot"` mode. Now we can plot the map by printing the `tm` object:

```{r, fig.height = 3.5, out.width = "100%", dpi = 300, fig.width = 7.2916667}
tm
Expand All @@ -100,32 +100,32 @@ ttm()
tm
```

Note that there is big difference: in this `"view"` mode there are basemaps, and in `"plot"` mode none. This is caused by different default option.
Note that there is a big difference: in `"view"` mode there are basemaps, and in `"plot"` mode none. This is caused by different default options.

Basemaps can be enabled or disabled via `tm_basemap()`:

```{r, fig.height = 3.5}
tm + tm_basemap(NULL)
```

See [vignette about basemaps](https://r-tmap.github.io/tmap/articles/06_basics_basemaps).
See [vignette about basemaps](https://r-tmap.github.io/tmap/articles/basics_basemaps).

## Mode specific options

Mode specific layout options can be set via `tm_plot()` and `tm_view()`. The number of options in `tm_plot()` is limited to just one, because it uses all general purpose options. In contrast, `tm_view()` contains more options, e.g. there to position the control box and what the default zoom level is:
Mode specific layout options can be set via `tm_plot()` and `tm_view()`. The number of options in `tm_plot()` is limited to just two, because it uses all general purpose options. In contrast, `tm_view()` contains more options, e.g. the position of the control box and the default zoom level:

```{r, fig.height = 3.5}
tm +
tm_view(control.position = c("left", "bottom"),
set_view = 2)
```

For a more detailed description of options, see [vignette about options](https://r-tmap.github.io/tmap/articles/42_adv_options).
For a more detailed description of the available options, see the [vignette about options](https://r-tmap.github.io/tmap/articles/adv_options).


## `mapgl` modes: `"mapbox" and `"maplibre"`.

The new package `mapgl` offers two new modes. The first is `"mapbox"` for which an API key is required, which is free for personal use. The second is `maplibre` for which no API key is requires.
The new package `mapgl` offers two new modes. The first is `"mapbox"` for which an API key is required, which is free for personal use. The second is `maplibre` for which no API key is required.

```{r, fig.height = 3.5}
library(tmap.mapgl)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/basics_vv.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ s <- tm_shape(World, crs = "+proj=eqearth")

## Constant visual values

Each visual variable can be assigned with a contant value. E.g. `fill = "red"` or `size = 2`.
Each visual variable can be assigned a constant value. E.g. `fill = "red"` or `size = 2`.

An example where several visual variables are specified with constant values:

Expand Down