Skip to content

Instantly share code, notes, and snippets.

@devmag
devmag / ejm-details
Created October 23, 2014 12:03
download EJM detail job listing information for job market candidates in economics
library(XML)
library(stringr)
library(RCurl)
library(plyr)
library(data.table)
###YOU NEED THE PREVIOUS OBJECT EJM
###NOW WE WANT TO GET THE INFORMATION ABOUT EACH JOB OPENING (UNIVERSITY / DESCRIPTION / DEADLINE)
@devmag
devmag / ejm-list
Created October 23, 2014 11:52
Downloading EJM links
setwd("/Users/thiemo/Dropbox/Research/Job Market/Job Openings/")
library(data.table)
###VERY USEFUL FUNCTION FROM TIMOTHEE CARAYOL
DTUniqueBy <- function(data, varvec) {
data <- as.data.table(data)
data[!duplicated(data.frame(data[, varvec, with=F]))]
}
options(stringsAsFactors=FALSE)
@devmag
devmag / spatial.R
Last active March 4, 2021 11:38
R scripts to compute Conley Type Standard Errors
#####VECTORISED FUNCTION
library(data.table)
library(geosphere)
library(foreign)
library(lfe)
library(reshape)
iterateObs<-function(y1,e1,X1,fordist,coefficients,cutoff=250000) {