Skip to content

Commit

Permalink
gs ls 03 misc edits
Browse files Browse the repository at this point in the history
  • Loading branch information
cbgvalera committed Feb 14, 2024
1 parent f5ccfc0 commit 84b7a56
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lessons/ls03_physical_features.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ This lesson requires familiarity with `{ggplot2}`: if you need to brush up, have

### How to plot them? {.unnumbered}

A *Physical feature map* mostly use the `color` argument.
Using `{ggplot2}`, `geom_sf()`, and the `color` argument.

#### With Categorical data {.unlisted .unnumbered}

Expand All @@ -98,6 +98,9 @@ ggplot(data = south_am_roads) +
Let's create a map of the Sacramento basin in California US (`sacramento_rivers`), colored by their feature type (`FTYPE`).

```{r,eval=FALSE}
sacramento_rivers <-
read_rds(here("data/sacramento_rivers.rds"))
ggplot(data = sacramento_rivers) +
geom_sf(aes(_____ = FTYPE), size = 1)
```
Expand All @@ -116,7 +119,7 @@ sacramento_rivers <-
read_rds(here("data/sacramento_rivers.rds"))
ggplot(data = sacramento_rivers) +
geom_sf(aes(color = richness), size = 1)
geom_sf(mapping = aes(color = richness))
```

"Richness" is the estimated number of fish species in each segment of the river.
Expand Down Expand Up @@ -155,7 +158,7 @@ We can complement Thematic maps with spatial *Physical features* like roads, bui

### How to plot them? {.unnumbered}

As an example, we will complement a Choropleth map with the population of African countries, from the `africountries`, with:
As an example, we will complement a Choropleth map with the population (`pop_est`) of African countries, from the `africountries`, with:

- the African trans-continental highway network lines, available in the `afrihighway` dataset from the same package.

Expand All @@ -180,7 +183,7 @@ This is how you plot another map layer on top of another map.
::: recap
`{ggplot2}` allows to **overlap multiple layers (of maps)** from different data sources to complement Thematic maps.

For this, instead of a *global* specification of data, you need to use a **local** one:
For this, instead of a *global* specification of data, you need a **local** specification of data:

``` r
# instead of:
Expand Down

0 comments on commit 84b7a56

Please sign in to comment.