课程: Data Visualization in R with ggplot2

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

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 like a choropleth map. In this video, we'll explore how to build this map, and then in the next video, we'll convert it to a choropleth map. We'll use a function called map_data from the ggplot library that allows us to retrieve the set of points that define a region. Let's give it 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 call it states, and then load in map data consisting of state objects. When I do that, I get a prompt that the map's package is required to use the map data function. Well, I'd like to install it, so let's go ahead down here and say,…

内容