From the course: Data Visualization in R with ggplot2

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating a choropleth map

Creating a choropleth map

From the course: Data Visualization in R with ggplot2

Start my 1-month free trial

Creating a choropleth map

- [Instructor] Choropleth maps are a powerful visualization tool that allow us to see regional differences in data. Earlier, we looked at how the CDC uses choropleth maps to track outbreaks of influenza. Now that you've learned how to build maps using polygons, you're ready to create your own choropleth maps. Let's give that a try in R. I already have the code here to load the college data set that we've been working with throughout this course. Let me go ahead and run that code. And then I'm also going to run code that populate a states variable with the state map_data as we did in the previous video. And now, what I'd like to do when I create my choropleth map is color code states based upon how many colleges and universities are in each state. Before I can plot that choropleth map, I need to first get my data in order. The first thing I need to do is figure out how many schools are in each state. I can use some functions from the dplyr library to help me with that. I'm going to…

Contents