课程: Data Visualization in R with ggplot2

免费学习该课程!

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

Working with map data

Working with map data

- [Instructor] Let's use the ggmap library to pull up some basic maps in R. We're going to use three different functions to do this. The qmap function stands for quick map. You can pass it the name of a location and it will retrieve a map of that area and plot it on the screen. You can also send other arguments that adjust the parameters of the map. We'll work with those in a moment. The get_map function takes the same arguments as qmap, but it only retrieves the map data and doesn't plot it. And the ggmap function plots a map that you retrieved with get_map. Let's try pulling up a map of New York City. I'm going to set the zoom level to 10, which is the standard zoom for showing a city that's a large metropolitan area. I'm going to use the qmap function and then just give it the location New York, NY, and then set my zoom level to 10. There's my map. I can experiment with the zoom to get a larger or smaller area, but my map is always centered on the same point, the coordinates set as…

内容