Hi there! For many different groups in `by`, `shift` is much slower than manual shifting. See: http://stackoverflow.com/questions/35179911/shift-in-data-table-v1-9-6-is-slow-for-many-groups and https://github.com/nachti/datatable_test/blob/master/leadtest.R for a detailed example. Cheers, Gerhard