I'm doing some aggregations on a data.table (excellent package!!!) and I found the .SD variable very useful for many things. However, using it slows down computation significantly when there are many groups. Follows an example:I'm doing some aggregations on a data.table (ex