UCDPtools – R package for the Uppsala Conflict Data Program

I’m happy to introduce UCDPtools, an R package for accessing data from the Uppsala Conflict Data Program (UCDP). UCDPtools includes UCDPindex that makes it easy to move around the websites and codebooks for the 15 UCDP datasets and the function getUCDP() that loads the datasets into R and fixes obvious errors and variable names.

browseURL(UCDPindex$codebook_link[UCDPindex$shortname=="One-Sided"])
onesided <- getUCDP("One-Sided", rawdata=TRUE, rawnames=TRUE)

The package is hosted on my github page and can be easily installed using the devtools package:

install.packages("devtools")
library(devtools)
install_github("tlscherer/UCDPtools", dependencies=TRUE)
library(UCDPtools)
data(UCDPindex)

I hope UCDPtools can become a one stop shop for tools and tricks for working with the UCDP datasets in R. Future iterations will have the datasets with different units, for example a year-actor version of “ArmedConflict” with a conflict count. If you have some code you would like to contribute, please contact me. Thanks to Jonathan Olmsted for assistance in packaging and Stephen Haptonstahl for making packages seem possible. All bugs are my own.

Share this post:
twittergoogle_plusredditlinkedin

Leave a Reply