Member-only story
R ggmap — How to Visualize Spatial Data in R
Mapping, routing, or geocoding — there’s nothing you can’t do with R ggmap — a package for spatial data visualization.
Spatial data is always tougher to visualize than it seems at first. Well, not anymore. R ggmap is an amazing package you can start using almost instantly, after some light configuration. It won’t take you more than a couple of minutes to configure everything and have your first map ready.
Today you’ll learn how to use the ggmap
package to do almost everything geodata-related. We'll kick things off by plotting basic maps, markers, and paths, and then dive into changing map themes. Once that's under our belt, we'll focus on advanced topics, including geocoding, reverse geocoding, drawing routes, and calculating distance between locations.
Want to build interactive Google Maps? Here’s a complete guide for interactive Google Maps in Shiny.
Introduction to R ggmap Package
First things first, there’s a bit of setup we have to go over. ggmap
uses Google Maps behind the scenes, so you'll need an active Google Cloud Platform account. You'll also have to set up billing, as it's required for their mapping APIs. Don't worry, GCP won't charge you a penny without…