Friday, 31 October 2014

Conflict data for October

Here's a quick animation of the Armed Conflict Location Event Database's realtime data for October.




I created this with the code:

acl <- read.csv("/Users/david/ACLEDoct27.csv")
acl$date <- as.Date(acl$EVENT_DATE, "%d-%b-%y")
acl <- acl[acl$date > as.Date("2014-10-01"),]


library(anim.plots)
library(maps)

tmp <- anim.points(LATITUDE ~ LONGITUDE + as.numeric(date),  

      data=acl , speed=1, col=rgb(1,0,0,.7), pch=19,
      cex=log(TOTAL_FATALITIES+1), show=F)

saveGIF(
  replay(tmp,
  before=map('world', fill=T, col=terrain.colors(5)[2:5],

     xlim=c(-20, 60), ylim=c(-40, 40)),
  after=legend("bottomleft", col="red", pt.cex=log(1+c(1,10,100)) ,
      legend=c(1,10,100), pch=19, y.intersp=1.5, x.intersp=1.5, 

      bty="n", title="Fatalities")),
  "conflict.gif")