Skip to content

Instantly share code, notes, and snippets.

# set working directory
makePath <- function(path, macUser, winUser){
if(Sys.info()['sysname']=="Windows"){
retpath <- paste("C:/Users/", winUser, sep="")
} else {
retpath <- paste("/Users/", macUser, sep="")
}
return(paste(retpath, path, sep=""))
}
# install devtools & obsval
install.packages("devtools")
library("devtools")
devtools::install_github("chrismeserole/obsval")
library("obsval")
# install secondary packages
install.packages("mvtnorm")
install.packages("nnet")
library(mvtnorm)
@chrismeserole
chrismeserole / gdelt-to-s3.sh
Last active December 19, 2015 15:58
This script downloads files from GDELT and then transfers to s3. It's best used on an EC2 instance, because it can rely on Amazon's internal bandwidth to upload to s3. To run the script, just enter something like 'sh gdelt-to-s3.sh 2000 2005', which will upload the csv files for each year between 2000 and 2005 to s3. For data after 2005, enter s…
#!/bin/sh
## NOTE: This relies on Tim Kay's AWS script, so uncomment
## the following lines if it is not installed:
# curl https://raw.github.com/timkay/aws/master/aws -o aws
# export EC2_ACCESS_KEY=<AWS_ACCESS_KEY>
# export EC2_SECRET_KEY=<AWS_SECRET_KEY>
# chmod +x aws
# perl aws --install