Skip to content

Instantly share code, notes, and snippets.

View felixhaass's full-sized avatar

Felix Haass felixhaass

View GitHub Profile
@ulfelder
ulfelder / freedomintheworld.converter
Last active April 20, 2016 14:54
Converts Freedom House's Freedom in the World data into standard country-year structure for time-series cross-sectional analysis.
# This script converts Freedom House's annual Freedom in the World data from
# the ugly, table-like Excel format in which it's posted into a data frame in R.
# It is set up to work on future updates, too, and should automatically adjust
# as years or countries are added.
#
# Before running this script:
#
# 1. Open a browser & go to http://www.freedomhouse.org/report-types/freedom-world
#
# 2. Download the file "Country ratings and status, FIW 1973-2013(EXCEL)"
@dsparks
dsparks / cairographics.R
Created September 24, 2012 19:12
Using cairographics with ggsave()
# .png with Windows GDI versus .png with cairographics
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("ggplot2", "RColorBrewer", "Cairo")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Generate some data
nn <- 100
myData <- data.frame(X = rnorm(nn),