Your Turn: Build a Spatial Story
Congrats! 🥳 You've completed the fifth module! You now know how to work with spatial data, create maps with ggplot2, customize them, and build tile grid layouts.
Now, let's put your spatial skills into practice: build a polished map visualization that tells a geographic story! 🗺️
🎯 The Challenge
You've learned how to work with spatial data structures, create maps with ggplot2, customize their appearance, and build alternative spatial layouts like cartograms and grid maps. Now it's time to bring it all together.
The idea of this project is to create a set of three maps to compare the different approaches directly. We're going to provide you with a GeoJSON dataset, and you will have to pick your favorite variable and build three different maps to represent the region of the world you currently live in .
- Build a choropleth map using traditional polygon fills with a suitable color palette.
- Build a grid map using your favorite shape to represent the same variable by color.
- Build a spatial grid of small multiples to showcase the same variable but over time.
💾 The Data
As you know by now, Gapminder provides a lot of variables about world countries, and we've transformed it into a GeoJSON format to link it with all the country boundaries.
We've built two special editions of the Gapminder dataset for you.
2022 Gapminder Metrics, But Spatial
To provide you with all you need for a spatial map, we put together a single file called gapminder-2022.geojson that you can load using the following code:
Every one of the 197 countries carries both a polygon geometry and its 2022 statistics, so you can map any variable straight away.
Use this dataset to create a choropleth map and a grid map of your region (however you define that) to represent one of the following variables for the year 2022:
country,iso_a3,country_name— country identifierscontinent,region,region_un,subregion— geographic groupings (handy for picking your region)pop— total populationgdp_pcap— GDP per capitalife_exp— life expectancy at birth, in yearsincome_daily— average daily incomeco2_pcap— CO₂ emissions per capita, in tonnesfertility— births per womangeometry— the country polygon (a stickysfcolumn)
Doors are closed 🚪
Enrollment for the current cohort is closed. Join the waitlist to be notified as soon as the next cohort opens, and become the ggplot2 expert your company needs!
Already enrolled? Login