Added R scripts for lagging and reshaping