Last active
December 24, 2015 07:48
-
-
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.
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
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