From the course: Data Visualization in R with ggplot2

Visualizing data with maps

- [Instructor] Maps provide a powerful way to visualize data. They allow us to quickly place data in the context of geographic area. For example, take a look at this data set from the Centers for Disease Control. It shows the spread of the flu across the United States during the 2017-2018 flu season. There's an entry in the file for each state, for each week, showing the level of flu activity in a state during a particular week. All the data is here, but just glancing at this file, it's very difficult to get a sense of how bad the flu outbreak was during this flu season. While tables and spreadsheets are not a great way to view geographic data. Maps provide a wonderful alternative, specifically, I'll show you the same data set using a visualization known as a choropleth map. That's just a fancy name for a map where different regions are color coded to show a variable. It's a great visualization for comparing the differences between regions and also for visualizing the spread of an event such as a flu outbreak. Here's a choropleth map from the CDC showing the flu levels in the United States, in the beginning of October 2017. The start of the flu season. A few states, like Kansas, Nebraska, Vermont, and New Hampshire have no flu activity shown here by vertical lines through those states. Most states, like New York, Indiana, and California had experienced sporadic cases of the flu, shown by the crosshatched lines. And we have two states, South Carolina and Colorado, shown in solid yellow, that have experienced localized flu outbreak activity. Notice the scale on the right side of the map. As a state's flu situation gets more severe, the coloring of that state gets darker, with brown representing a widespread outbreak. This visualization by itself is very helpful in looking at a point in time snapshot of the flu, but it can become even more powerful when we show it in a time series format by displaying weeks one after another. Let me press play here, and we can see how the flu spread across the US during this flu season. You can see how local flu outbreaks became regional outbreaks, and how those regional outbreaks turned into widespread outbreaks, until most of the country was experiencing a significant flu season. In the next few videos, you'll learn how you can create your own map-based visualizations to better display geographic data.

Contents