Skip to content

Commit

Permalink
Update _09-ex.Rmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowosad committed Apr 26, 2024
1 parent be08d2c commit d481b77
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions _09-ex.Rmd
Expand Up @@ -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
Expand Down Expand Up @@ -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) +
Expand Down Expand Up @@ -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")
Expand All @@ -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) +
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit d481b77

Please sign in to comment.