Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quick map in R using ggmap
library(ggmap)
library(source.gist)
# Get data frame with coordinates for points
source.gist("6705264")
head(egy.points)
# Get background map
egy.map <- get_map(location=c(lon=30, lat=26), zoom=6, maptype="terrain", filename="~/Desktop/ggmapTemp")
p <- ggmap(egy.map) +
geom_point(data=egy.points, aes(x=Longitude, y=Latitude), col="red", size=5)
# Map it
#png("~/Desktop/egy_map.png", width=1024, height=1024)
p
#dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment