Created
November 21, 2017 10:16
-
-
Save iUmarov/c02ae14c5ecc4a3d1f1df9e6a285235d to your computer and use it in GitHub Desktop.
Starbucks near Ohio state
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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
https://cran.r-project.org/web/packages/googleway/vignettes/googleway-vignette.html