How to combine Google maps and data in R

[This article was first published on Revolutions, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Every good artist needs a canvas, and when it comes to displaying geographic data placing those data in context — on a map — makes all the difference. A new package for R from Markus Loecher, RgoogleMaps, allows you to download a street or satellite map from Google simply by specifying the bounding latitude/longitude coordinates. (You need to sign up for a free Google API key first, though.) You can then overlay data from objects in R, using tools provided to convert to the map-based coordinate system. Here’s an example from the package vignette overlaying the locations of faults (provided as data in the geomapdata package) on a satellite map:

Satellite map

 

You can find the commands to create this map in R, along with other examples, in the package vignette linked below.

RgoogleMaps package: Vignette: Plotting on Google Static Maps in R (PDF) (via @DataJunkie)

To leave a comment for the author, please follow the link and comment on their blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)