From the course: Data Visualization in R with ggplot2
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Working with map data
From the course: Data Visualization in R with ggplot2
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…
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
-
-
-
-
-
-
(Locked)
Visualizing data with maps2m 14s
-
(Locked)
Obtaining a Google Maps API key5m 19s
-
(Locked)
Working with map data2m 32s
-
(Locked)
Geocoding points3m 26s
-
(Locked)
Changing map types1m 19s
-
(Locked)
Plotting points on a map5m 6s
-
(Locked)
Building a map manually4m 21s
-
(Locked)
Creating a choropleth map6m 53s
-
(Locked)
-
-