How to map data with R
A hands-on tutorial to get you to start creating maps with R.
Maps are one of the widely read and understood visualizations that keep getting more and more traction. Since the start of the pandemic, the maps caught my attention again after a gap of more than two decades. The internet was flooded with visualizations depicting the spread of the virus, and one such visualization or rather a dashboard attracted me was from John Hopkins University. By adding the map with the various plots, the dashboard painted a different picture. The data was more clear and informative than just looking at the daily rise in the number of cases. The map helped in comparing globally or locally, where the cases were rising.
This was the reason, I so much wanted to try my hands on creating maps with R and finally found the time to do it. Here is John Hopkin’s dashboard in case you haven't seen it before:
In this tutorial, we will learn to work with maps using the ggplot2()
package. The objectives for this tutorial are:
- Loading the world map.
- Narrowing down on a…