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
From the course: Data Visualization in R with ggplot2
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Visualizing data with maps2m 38s
-
(Locked)
Obtaining a Google Maps API key6m 58s
-
(Locked)
Working with maps3m 27s
-
(Locked)
Geocoding points4m 37s
-
(Locked)
Changing map types4m 18s
-
(Locked)
Plotting points on a map6m 42s
-
(Locked)
Building a map manually5m 37s
-
(Locked)
Creating a choropleth map9m 16s
-
-
-