Following on from my last post, here is a bit more about the use of .I in data.table.

Scenario : you want to obtain either the first, or last row, from a set of rows that belong to a particular group.

For example, for a patient admitted to …

Continue reading: more .I in …