Skip to content

Instantly share code, notes, and snippets.

@andybega
Created September 25, 2013 21:21
Show Gist options
  • Save andybega/6706212 to your computer and use it in GitHub Desktop.
Save andybega/6706212 to your computer and use it in GitHub Desktop.
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