rgoogle-mapsrgooglemaps

RgoogleMaps city by name


Is it possible to list cities by name rather by longitude and latitude to include them on a map using RgoogleMaps?

Instead of qbbox (see example below), I want to provide a list of cities as an argument.

EX 1. bb = qbbox(c(59.95, 59.7, 59.3, 62),c(10.7,10.3, 11.4,11.4))

Solution

  • Solved with ggmap. I used the geocode function to map cities to lon/lat.

    library(ggmap)
    lonlat <- geocode(unique(cities))