From 84b7a56555e1ef95432bcf0cd47ca1196ab6788b Mon Sep 17 00:00:00 2001 From: Camille Beatrice Valera Date: Wed, 14 Feb 2024 17:29:04 +0100 Subject: [PATCH] gs ls 03 misc edits --- lessons/ls03_physical_features.Rmd | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lessons/ls03_physical_features.Rmd b/lessons/ls03_physical_features.Rmd index 7117d0e..f39b843 100644 --- a/lessons/ls03_physical_features.Rmd +++ b/lessons/ls03_physical_features.Rmd @@ -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} @@ -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) ``` @@ -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. @@ -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. @@ -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: