Those of you who do large-N, statistical analysis of human rights might find handy an R utility that Zach Jones (PhD student, Penn State) has written. Danny Hill alerted me to it, explaining in an email:
It will scrape the UN website and automatically generate panel data on signature and ratification of any UN human rights treaty, even noting accession and succession. You can download it from Zach’s GitHub here: https://github.com/zmjones/untreaties There are also user instructions on that page.
At that github link Zach provides the following description of what you can do with his script:
The R script
utilities.R contains a number of functions that make working with the raw data easier. You can load these functions by simply sourcing the file. It requires
loadDataloads the data for a specific treaty given its chapter and treaty numbers, which are passed as strings. You can optionally expand the column names (if needed). If you choose to expand the column names you can also transform the data into a country-year format, given a start year and an end year (both passed as strings).
searchTreatiessearches through the
index.csvusing approximate string matching given a maximum distance (internally it uses
agrep). If multiple matches are found, the user can select the best match from the console. The
trimoption is logical and truncates console output to 80 characters (it is true by default). This function calls
loadDatainternally, and allows overloading, so you can pass arguments to
loadDataby passing arguments to
searchTreaties. Note that you have to name the arguments explicitly (you can’t just use argument ordering).
createColumnstakes a character vector of dates (or a dataframe with one column) with a trailing type identifier (a one or two character code) and a name for said column. It returns an expanded version of that column with column dimension equal to the number of unique type identifiers plus one (for the no identifier category).
expandColumnstakes a dataframe that may need to be expanded, passes columns that need to be expanded to
createColumns, and combines the results.
convertPaneltakes a character vector of dates (of the form
"%d-%b-%Y") and a year for comparison and returns a binary variable indicating whether the year of the date that was passed is less than or equal to the comparison year.
expandPaneltakes a dataframe, a start year, and an ending year (both strings), and returns a dataframe with in country-year format with each data column converted into a binary variable.
findDatestakes a dataframe and finds columns which follow the
%d-%b-%Ydate format. Optionally allows for dates with a trailing type identifier.