From the course: Data Visualization in R with ggplot2 (2018)

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Building a map manually

Building a map manually

- [Instructor] We've explored creating many different map types using the ggmap library, but sometimes you may want to create a very simple map as the basis for another visualization. For example, I might want a map of the United States that simply shows the outline of each state with no other information. A map like this can be the starting point for many other visualizations including Choropleth maps. In this video, we'll explore how to build this map and then in the next video, we'll use it to create a choropleth map. We'll use a function called map underscore data from the ggplot library that allows us to retrieve the set of points that define a region. Let's give this a try in R. I'll begin by using the map data function to load a map of the United States. I'm going to store those points that define the United States in a variable called states and I'm going to populate it by calling map underscore data with the argument states. When I run this, states is populated with a lot of…

Contents