Skip to content

Instantly share code, notes, and snippets.

@devmag
devmag / spatial.R
Last active Mar 4, 2021
R scripts to compute Conley Type Standard Errors
View spatial.R
#####VECTORISED FUNCTION
library(data.table)
library(geosphere)
library(foreign)
library(lfe)
library(reshape)
iterateObs<-function(y1,e1,X1,fordist,coefficients,cutoff=250000) {
@devmag
devmag / ejm-details
Created Oct 23, 2014
download EJM detail job listing information for job market candidates in economics
View ejm-details
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 Oct 23, 2014
Downloading EJM links
View ejm-list
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)