Skip to content

Instantly share code, notes, and snippets.

@andybega
Last active December 24, 2015 07:48
Show Gist options
  • Save andybega/6765821 to your computer and use it in GitHub Desktop.
Save andybega/6765821 to your computer and use it in GitHub Desktop.
Map of protests in Turkey from January 2011 to September 2013, from GDELT event data.
library(ggmap)
library(source.gist)
# Get data frame with coordinates for points
source.gist("6765348")
head(turkey.prot)
# Get background map
tr.map <- get_map(location=c(lon=34, lat=37), zoom=5, maptype="terrain", filename="~/Desktop/ggmapTemp")
p <- ggmap(tr.map) +
stat_sum(data=turkey.prot, aes(x=longitude, y=latitude, group=1),
col="red", alpha=0.6) +
scale_size_continuous(trans="log") +
scale_size(range=c(4, 12))
# Map it
png("~/Desktop/tr_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