Created
November 21, 2017 10:14
-
-
Save iUmarov/a1edd61db3a015b37188735a8b615d33 to your computer and use it in GitHub Desktop.
7 Markers in Tashkent
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("ggplot2") | |
library(ggplot2) | |
names <- c("Toshkent Xalqa Avtomobil Yo'li, Tashkent, Uzbekistan", | |
"Istiklol Palace", | |
"Dinamo", | |
"Tashkent Higher All-Troops Command College", | |
"SARC Uzbekiston Temir Yullari", | |
"Amir Temur Square", | |
"MY HOME") | |
addr <- c("Toshkent Xalqa Avtomobil Yo'li, Tashkent, Uzbekistan", | |
"Istiklol Palace, Tashkent, Uzbekistan", | |
"Dinamo, Tashkent, Uzbekistan", | |
"Tashkent Higher All-Troops Command College, Tashkent, Uzbekistan", | |
"SARC Uzbekiston Temir Yullari, Tashkent, Uzbekistan", | |
"Amir Temur Square, Tashkent, Uzbekistan", | |
"69.207378, 41.375954") | |
#coords <- geocode(enc2utf8(addr)) | |
#lon <- c(69.207378) | |
#lat <- c(41.375954) | |
#myhome <- as.data.frame(cbind(lon,lat)) | |
#coords | |
gc <- rbind(coords, myhome) | |
df <- data.frame(name = names, lon = gc$lon, lat = gc$lat) | |
cen <- c(mean(df$lon), mean(df$lat)) | |
map <- get_googlemap(center = cen, maptype = "roadmap", zoom = 11, marker = gc) | |
gmap <- ggmap(map) | |
gmap + geom_text(data = df, aes(x = lon, y = lat), | |
size = 3, label = df$name) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment