ggmap: Spatial Visualization with ggplot2
Publication type: Journal Article
Publication date: 2019-02-12
scimago Q1
wos Q3
SJR: 0.949
CiteScore: 4.4
Impact factor: 1.1
ISSN: 20734859
Statistics and Probability
Statistics, Probability and Uncertainty
Numerical Analysis
Abstract
In spatial statistics the ability to visualize data and models superimposed with their basic social landmarks and geographic context is invaluable. ggmap is a new tool which enables such visualization by combining the spatial information of static maps from Google Maps, OpenStreetMap, Stamen Maps or CloudMade Maps with the layered grammar of graphics implementation of ggplot2. In addition, several new utility functions are introduced which allow the user to access the Google Geocoding, Distance Matrix, and Directions APIs. The result is an easy, consistent and modular framework for spatial graphics with several convenient tools for spatial data analysis. Introduction Visualizing spatial data in R can be a challenging task. Fortunately the task is made a good deal easier by the data structures and plot methods of sp, RgoogleMaps, and related packages (Pebesma and Bivand, 2006; Bivand et al., 2008; Loecher and Berlin School of Economics and Law, 2013). Using those methods, one can plot the basic geographic information of (for instance) a shape file containing polygons for areal data or points for point referenced data. However, compared to specialized geographic information systems (GISs) such as ESRI’s ArcGIS, which can plot points, polygons, etc. on top of maps and satellite imagery with drag-down menus, these visualizations can be pretty disappointing. This article details some new methods for the visualization of spatial data in R using the layered grammar of graphics implementation of ggplot2 in conjunction with the contextual information of static maps from Google Maps, OpenStreetMap, Stamen Maps or CloudMade Maps (Wickham, 2009, 2010). The result is an easy to use R package named ggmap. After describing the nuts and bolts of ggmap, we showcase some of its capabilities in a simple case study concerning violent crimes in downtown Houston, Texas and present an overview of a few utility functions. Plotting spatial data in R Areal data is data which corresponds to geographical extents with polygonal boundaries. A typical example is the number of residents per zip code. Considering only the boundaries of the areal units, we are used to seeing areal plots in R which resemble those in Figure 1 (left). -96.0 -95.5 -95.0 -94.5 29 .0 29 .5 30 .0 30 .5 longitude la tit ud e -96.0 -95.5 -95.0 -94.5 29 .0 29 .5 30 .0 30 .5 longitude la tit ud e Figure 1: A typical R areal plot – zip codes in the Greater Houston area (left), and a typical R spatial scatterplot – murders in Houston from January 2010 to August 2010 (right). While these kinds of plots are useful, they are not as informative as we would like in many situations. For instance, when plotting zip codes it is helpful to also see major roads and other landmarks which form the boundaries of areal units. The situation for point referenced spatial data is often much worse. Since we can’t easily contextualize a scatterplot of points without any background information at all, it is common to add points as The R Journal Vol. 5/1, June ISSN 2073-4859 CONTRIBUTED RESEARCH ARTICLES 145 an overlay of some areal data—whatever areal data is available. The resulting plot looks like Figure 1 (right). In most cases the plot is understandable to the researcher who has worked on the problem for some time but is of hardly any use to his audience, who must work to associate the data of interest with their location. Moreover, it leaves out many practical details—are most of the events to the east or west of landmark x? Are they clustered around more well-to-do parts of town, or do they tend to occur in disadvantaged areas? Questions like these can’t really be answered using these kinds of graphics because we don’t think in terms of small scale areal boundaries (e.g. zip codes or census tracts). With a little effort better plots can be made, and tools such as maps, maptools, sp, or RgoogleMaps make the process much easier; in fact, RgoogleMaps was the inspiration for ggmap (Becker et al., 2013; Bivand and Lewin-Koh, 2013). Moreover, there has recently been a deluge of interest in the subject of mapmaking in R—Ian Fellows’ excellent interactive GUI-driven DeducerSpatial package based on Bing Maps comes to mind (Fellows et al., 2013). ggmap takes another step in this direction by situating the contextual information of various kinds of static maps in the ggplot2 plotting framework. The result is an easy, consistent way of specifying plots which are readily interpretable by both expert and audience and safeguarded from graphical inconsistencies by the layered grammar of graphics framework. The result is a spatial plot resembling Figure 2. Note that map images and information in this work may appear slightly different due to map provider changes over time. murder
Found
Nothing found, try to update filter.
Top-30
Journals
|
10
20
30
40
50
60
70
80
|
|
|
Scientific Reports
73 publications, 4.39%
|
|
|
PLoS ONE
38 publications, 2.29%
|
|
|
Science of the Total Environment
25 publications, 1.5%
|
|
|
Molecular Ecology
20 publications, 1.2%
|
|
|
Nature Communications
19 publications, 1.14%
|
|
|
Ecology and Evolution
19 publications, 1.14%
|
|
|
PeerJ
16 publications, 0.96%
|
|
|
PLoS Neglected Tropical Diseases
12 publications, 0.72%
|
|
|
Fisheries Research
11 publications, 0.66%
|
|
|
Frontiers in Marine Science
10 publications, 0.6%
|
|
|
Environmental Science & Technology
10 publications, 0.6%
|
|
|
Diversity
9 publications, 0.54%
|
|
|
Biological Conservation
9 publications, 0.54%
|
|
|
Marine Pollution Bulletin
9 publications, 0.54%
|
|
|
Global Change Biology
9 publications, 0.54%
|
|
|
Molecular Biology and Evolution
9 publications, 0.54%
|
|
|
International Journal of Environmental Research and Public Health
8 publications, 0.48%
|
|
|
Frontiers in Microbiology
8 publications, 0.48%
|
|
|
SSRN Electronic Journal
8 publications, 0.48%
|
|
|
Ecography
8 publications, 0.48%
|
|
|
Ecosphere
8 publications, 0.48%
|
|
|
Canadian Journal of Fisheries and Aquatic Sciences
7 publications, 0.42%
|
|
|
Science
7 publications, 0.42%
|
|
|
Methods in Ecology and Evolution
7 publications, 0.42%
|
|
|
Proceedings of the National Academy of Sciences of the United States of America
7 publications, 0.42%
|
|
|
Nature Ecology and Evolution
6 publications, 0.36%
|
|
|
Geophysical Research Letters
6 publications, 0.36%
|
|
|
F1000Research
6 publications, 0.36%
|
|
|
Proceedings of the Royal Society B: Biological Sciences
6 publications, 0.36%
|
|
|
10
20
30
40
50
60
70
80
|
Publishers
|
50
100
150
200
250
300
350
|
|
|
Springer Nature
344 publications, 20.69%
|
|
|
Elsevier
287 publications, 17.26%
|
|
|
Wiley
249 publications, 14.97%
|
|
|
Cold Spring Harbor Laboratory
98 publications, 5.89%
|
|
|
MDPI
74 publications, 4.45%
|
|
|
Public Library of Science (PLoS)
63 publications, 3.79%
|
|
|
Oxford University Press
57 publications, 3.43%
|
|
|
Frontiers Media S.A.
52 publications, 3.13%
|
|
|
Taylor & Francis
41 publications, 2.47%
|
|
|
Cambridge University Press
21 publications, 1.26%
|
|
|
Copernicus
20 publications, 1.2%
|
|
|
Institute of Electrical and Electronics Engineers (IEEE)
19 publications, 1.14%
|
|
|
PeerJ
16 publications, 0.96%
|
|
|
Canadian Science Publishing
15 publications, 0.9%
|
|
|
American Chemical Society (ACS)
15 publications, 0.9%
|
|
|
The Royal Society
14 publications, 0.84%
|
|
|
American Association for the Advancement of Science (AAAS)
13 publications, 0.78%
|
|
|
SAGE
12 publications, 0.72%
|
|
|
Pensoft Publishers
11 publications, 0.66%
|
|
|
Inter-Research Science Center
10 publications, 0.6%
|
|
|
F1000 Research
8 publications, 0.48%
|
|
|
American Geophysical Union
7 publications, 0.42%
|
|
|
Ovid Technologies (Wolters Kluwer Health)
7 publications, 0.42%
|
|
|
Social Science Electronic Publishing
7 publications, 0.42%
|
|
|
Scientific Societies
7 publications, 0.42%
|
|
|
BMJ
7 publications, 0.42%
|
|
|
John Benjamins Publishing Company
7 publications, 0.42%
|
|
|
Proceedings of the National Academy of Sciences (PNAS)
7 publications, 0.42%
|
|
|
University of Chicago Press
6 publications, 0.36%
|
|
|
50
100
150
200
250
300
350
|
- We do not take into account publications without a DOI.
- Statistics recalculated weekly.
Are you a researcher?
Create a profile to get free access to personal recommendations for colleagues and new articles.
Metrics
1.7k
Total citations:
1663
Citations from 2024:
353
(21.23%)
Cite this
GOST |
RIS |
BibTex |
MLA
Cite this
RIS
Copy
TY - JOUR
DO - 10.32614/RJ-2013-014
UR - https://doi.org/10.32614/RJ-2013-014
TI - ggmap: Spatial Visualization with ggplot2
T2 - R Journal
AU - Kahle, David
AU - Wickham, Hadley
PY - 2019
DA - 2019/02/12
PB - R Foundation for Statistical Computing
SP - 144
IS - 1
VL - 5
SN - 2073-4859
ER -
Cite this
BibTex (up to 50 authors)
Copy
@article{2019_Kahle,
author = {David Kahle and Hadley Wickham},
title = {ggmap: Spatial Visualization with ggplot2},
journal = {R Journal},
year = {2019},
volume = {5},
publisher = {R Foundation for Statistical Computing},
month = {feb},
url = {https://doi.org/10.32614/RJ-2013-014},
number = {1},
pages = {144},
doi = {10.32614/RJ-2013-014}
}
Cite this
MLA
Copy
Kahle, David, and Hadley Wickham. “ggmap: Spatial Visualization with ggplot2.” R Journal, vol. 5, no. 1, Feb. 2019, p. 144. https://doi.org/10.32614/RJ-2013-014.