jknowles/eeptools — pull request #12 by jasonpbecker (2013-09-12 19:30:08+00:00)
Title: Student mobility calculator

This is a new function that calculates the number of "moves" a student has had using the following business rules:

Students who enroll after `enrollby` get 1 move.
Students who exit before `exitby` get 1 move.
Students who have a new enrollment record at the same school in less than `gap` days does not get any moves.
Students who change schools with a gap of less than `gap` days get 1 move.
Students who have changed schools with a gap of greater than `gap` days receive 2 moves, with the assumption being they must have enrolled somewhere else in the gap in data (this is especially helpful for districts, but is also relevant to states when students move out of state and then back).

This depends on `data.table`.