How to combine Google maps and data in R
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:
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)
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.