Skip to content

Instantly share code, notes, and snippets.

@iUmarov
Created November 21, 2017 10:16
Show Gist options
  • Save iUmarov/c02ae14c5ecc4a3d1f1df9e6a285235d to your computer and use it in GitHub Desktop.
Save iUmarov/c02ae14c5ecc4a3d1f1df9e6a285235d to your computer and use it in GitHub Desktop.
Starbucks near Ohio state
#install.packages("googleway")
library(googleway)
key <- 'AIzaSyCOEzgiO1P6trrSmu9vy9ZVuQDkog6Lwiw'
df_places <- google_places(search_string = "Starbucks",
location = c(40.417287, -82.907123),
key = key)
df_places$results$formatted_address
cen <- c(mean(df_places$results$geometry$location$lng), mean(df_places$results$geometry$location$lat))
gc <- data.frame(lon=df_places$results$geometry$location$lng, lat = df_places$results$geometry$location$lat)
map <- get_googlemap(center = cen, scale = 1, maptype = "roadmap", zoom = 10, marker = gc)
ggmap(map, extent = "device")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment