diff --git a/_09-ex.Rmd b/_09-ex.Rmd index 093bc5e08..bd5ff49da 100644 --- a/_09-ex.Rmd +++ b/_09-ex.Rmd @@ -28,9 +28,9 @@ nlcd = rast(system.file("raster/nlcd.tif", package = "spDataLarge")) E1. Create a map showing the geographic distribution of the Human Development Index (`HDI`) across Africa with base **graphics** (hint: use `plot()`) and **tmap** packages (hint: use `tm_shape(africa) + ...`). - - Name two advantages of each based on the experience. - - Name three other mapping packages and an advantage of each. - - Bonus: create three more maps of Africa using these three other packages. +- Name two advantages of each based on the experience. +- Name three other mapping packages and an advantage of each. +- Bonus: create three more maps of Africa using these three other packages. ```{r} # graphics @@ -87,9 +87,9 @@ tmap_arrange(ahdi, asubregions) E4. Create a land cover map of the Zion National Park. - - Change the default colors to match your perception of the land cover categories - - Add a scale bar and north arrow and change the position of both to improve the map's aesthetic appeal - - Bonus: Add an inset map of Zion National Park's location in the context of the Utah state. (Hint: an object representing Utah can be subset from the `us_states` dataset.) +- Change the default colors to match your perception of the land cover categories +- Add a scale bar and north arrow and change the position of both to improve the map's aesthetic appeal +- Bonus: Add an inset map of Zion National Park's location in the context of the Utah state. (Hint: an object representing Utah can be subset from the `us_states` dataset.) ```{r} tm_shape(nlcd) + @@ -151,8 +151,8 @@ print(inset, vp = ins_vp) E5. Create facet maps of countries in Eastern Africa: - - With one facet showing HDI and the other representing population growth (hint: using variables `HDI` and `pop_growth`, respectively) - - With a 'small multiple' per country +- With one facet showing HDI and the other representing population growth (hint: using variables `HDI` and `pop_growth`, respectively) +- With a 'small multiple' per country ```{r} ea = subset(africa, subregion == "Eastern Africa") @@ -167,8 +167,8 @@ tm_shape(ea) + E6. Building on the previous facet map examples, create animated maps of East Africa: - - Showing each country in order - - Showing each country in order with a legend showing the HDI +- Showing each country in order +- Showing each country in order with a legend showing the HDI ```{r, eval=FALSE} tma1 = tm_shape(ea) + @@ -190,10 +190,10 @@ browseURL("tma2.gif") E7. Create an interactive map of HDI in Africa: - - With **tmap** - - With **mapview** - - With **leaflet** - - Bonus: For each approach, add a legend (if not automatically provided) and a scale bar +- With **tmap** +- With **mapview** +- With **leaflet** +- Bonus: For each approach, add a legend (if not automatically provided) and a scale bar ```{r, eval=FALSE} # tmap @@ -214,9 +214,9 @@ leaflet(africa4326) |> E8. Sketch on paper ideas for a web mapping app that could be used to make transport or land-use policies more evidence based: - - In the city you live, for a couple of users per day - - In the country you live, for dozens of users per day - - Worldwide for hundreds of users per day and large data serving requirements +- In the city you live, for a couple of users per day +- In the country you live, for dozens of users per day +- Worldwide for hundreds of users per day and large data serving requirements ```{asis} Ideas could include identification of routes where many people currently drive short distances, ways to encourage access to parks, or prioritization of new developments to reduce long-distance travel. @@ -230,8 +230,8 @@ Worldwide, a database to serve the data would likely be needed. Then various fro E9. Update the code in `coffeeApp/app.R` so that instead of centering on Brazil the user can select which country to focus on: - - Using `textInput()` - - Using `selectInput()` +- Using `textInput()` +- Using `selectInput()` ```{asis} The answer can be found in the `shinymod` branch of the geocompr repo: https://github.com/Robinlovelace/geocompr/pull/318/files