Downloading and plotting a Google map of an area

You can use the RgoogleMaps package to get and plot Google maps of specific areas based on latitude and longitude. This approach offers tremendous ease of use. However, we do not gain much control over the map elements and how we plot the maps. For fine control, you can use some of the later recipes in this chapter.

Getting ready

Install the RgoogleMaps package using the following command:

install.packages("RgoogleMaps")

How to do it...

To download and use Google maps of an area, follow these steps:

  1. Load the RgoogleMaps package:
    > library(RgoogleMaps)
  2. Determine the latitude and longitude of the location for which you need a map. In this recipe, you will get the map for the neighborhood of Seton Hall University ...

Get R: Recipes for Analysis, Visualization and Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.