powered by
lagshift(x, i, lagMax, pad)
lagshift(1:3,0,1,NA)
Run the code above in your browser using DataLab