Mapping—The ggmap Package
Learn to construct visually appealing maps using ggmap.
We'll cover the following...
In this lesson, we cover the basics of ggmap
and how it can be used to create aesthetically pleasing visualizations that are presentation ready! The ggmap
package allows the efficient creation of maps by combining the visualization capabilities of ggplot2
with online mapping tools such as Google Maps. This package is handy for data scientists who work with spatial data and want to create high-quality maps with minimal code.
Use cases
The ggmap
package is a helpful tool for visualizing information on maps. It has applications in public health, environmental science, transportation planning, and business analytics. For example, a public health researcher might use ggmap
to visualize the distribution of disease cases across a city or region. In contrast, a transportation planner might use ggmap
to analyze traffic patterns and identify areas where infrastructure improvements are needed. Additionally, businesses may use ggmap
to visualize the distribution of their customers, competitors, or sales territories. Specifically, ggmap
is most useful for:
-
Exploring spatial patterns: With geospatial data, it’s often necessary to visualize data on a map to grasp specific patterns. The
ggmap
package lets us efficiently map statistical patterns to geographic maps to quickly identify spatial patterns and trends that may not be visible in a traditional scatter plot or bar chart. -
Communicating results: In data science, maps can be a powerful tool for communicating data-driven insights to non-technical audiences. When a map is well-made and insightful, it can solidify results for an audience and make an abstract idea feel much more concrete.
Advantages
For data scientists, there are several reasons to use ggmap
over other mapping ...