We will also use zion and nlcd datasets from spDataLarge:

    1. zion = st_read((system.file("vector/zion.gpkg", package = "spDataLarge")))
    2. data(nlcd, package = "spDataLarge")
    • Create a map showing the geographic distribution of the Human Development Index (HDI) across Africa with base graphics (hint: use ) 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 packages.
    • Extend the tmap created for the previous exercise so the legend has three bins: “High” (HDI above 0.7), “Medium” (HDI between 0.55 and 0.7) and “Low” (HDI below 0.55).
      • Bonus: improve the map aesthetics, for example by changing the legend title, class labels and color palette.
    • Represent africa’s subregions on the map.Change the default color palette and legend title.Next, combine this map and the map created in the previous exercise into a single plot.
    • Create a land cover map of the Zion National Park.
      • Change the default colors to match your perception of the land cover categories
      • 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.)
    • Create facet maps of countries in Eastern Africa:
      • With one facet showing HDI and the other representing population growth (hint: using variables HDI and , respectively)
      • With a ‘small multiple’ per country
    • Building on the previous facet map examples, create animated maps of East Africa:
      • Showing first the spatial distribution of HDI scores then population growth
      • Showing each country in order
    • Create an interactive map of Africa:
      • With tmap
      • With mapview
      • With leaflet
      • Bonus: For each approach, add a legend (if not automatically provided) and a scale bar
    • 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()
    • Reproduce Figure and the 1st and 6th panel of Figure 8.6 as closely as possible using the ggplot2 package.
    • Join us_states and us_states_df together and calculate a poverty rate for each state using the new dataset.Next, construct a continuous area cartogram based on total population.Finally, create and compare two maps of the poverty rate: (1) a standard choropleth map and (2) a map using the created cartogram boundaries.What is the information provided by the first and the second map?How do they differ from each other?
    • Visualize population growth in Africa.Next, compare it with the maps of a hexagonal and regular grid created using the geogrid package.

    Murrell, Paul. 2016. R Graphics. Second. CRC Press.

    Brewer, Cynthia A. 2015. Designing Better Maps: A Guide for GIS Users. Second. Redlands, California: Esri Press.

    Talbert, Richard J. A. 2014. Ancient Perspectives: Maps and Their Place in Mesopotamia, Egypt, Greece, and Rome. University of Chicago Press.

    Pebesma, Edzer J, and Roger S Bivand. 2005. “Classes and Methods for Spatial Data in R.” R News 5 (2): 9–13.

    Tennekes, Martijn. 2018. “Tmap: Thematic Maps in R.” Journal of Statistical Software, Articles 84 (6): 1–39. .

    Wilkinson, Leland, and Graham Wills. 2005. The Grammar of Graphics. Springer Science+ Business Media.

    Borland, David, and Russell M Taylor II. 2007. “Rainbow Color Map (Still) Considered Harmful.” IEEE Computer Graphics and Applications 27 (2). IEEE.

    Meulemans, Wouter, Jason Dykes, Aidan Slingsby, Cagatay Turkay, and Jo Wood. 2017. “Small Multiples with Gaps.” IEEE Transactions on Visualization and Computer Graphics 23 (1): 381–90. https://doi.org/10.1109/TVCG.2016.2598542.

    Pezanowski, Scott, Alan M MacEachren, Alexander Savelyev, and Anthony C Robinson. 2018. “SensePlace3: A Geovisual Framework to Analyze PlaceTimeAttribute Information in Social Media.” Cartography and Geographic Information Science 45 (5): 420–37. .

    Wickham, Hadley. 2016. Ggplot2: Elegant Graphics for Data Analysis. Second. New York, NY: Springer.


    • If there is a clash between a fixed value and a column name, the column name takes precedence. This can be verified by running the next code chunk after running nz$red = 1:nrow(nz).

    • col = "MAP_COLORS" can be used in maps with a large number of individual polygons (for example, a map of individual countries) to create unique colors for adjacent polygons.

    • See the “Color blindness simulator” options in .