::install_github("r-tmap/tmap@v4") remotes
1 tmap version 4
1.1 Intro
Let’s start by installing tmap version 4:
Then attach some packages…
library(sf)
library(terra)
library(spData)
library(tmap)
… and create our first map (Figure 1.1)!
tm_shape(nz) +
tm_borders()
1.2 My second map
As mentioned in Section 1.1, we are going to make some maps!
tm_shape(nz) +
tm_polygons(fill = "Median_income",
fill.scale = tm_scale_continuous(values = "viridis"),
fill.legend = tm_legend(title = "Median income\n(USD, 2007)")) +
tm_graticules() +
tm_compass(position = tm_pos_in("left", "top")) +
tm_scalebar() +
tm_title("Wowwowowwow") +
tm_credits("OGH2023")
Version | Description |
---|---|
3 | Good |
4 | Better |
This will be a reference to Knuth (1984).