Book Image

Learning R for Geospatial Analysis

By : Michael Dorman
Book Image

Learning R for Geospatial Analysis

By: Michael Dorman

Overview of this book

Table of Contents (18 chapters)
Learning R for Geospatial Analysis
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
External Datasets Used in Examples
Cited References
Index

Plotting with ggplot2 and ggmap


In this section, you are going to learn how to use ggplot2 and ggmap to visualize spatial data. The section is structured as follows. First, we will review the ggplot2 framework using a simple example of a time series plot since (as you will see right away) the syntax is quite different from that of other plotting methods we used until now. After that, we will practice a little bit more with producing ordinary, nonspatial plots. Next, we will see how the ggplot2 plots can be saved for subsequent use, both within the R environment and in external files. Finally, the last two sections will deal with the most important material from this book's perspective. In these two sections, we will see how spatial data can be incorporated into ggplot2 visualizations to produce maps, and how we can conveniently download reference background images for such maps using ggmap.

Before going into the details of ggplot2, it is important to state that to use this package, our input...