I often want to know a group's index in transform statements, especially when I have sorted while grouping and need to continue doing something with this order. There is currently no easy way to access the group indices.
data.table has the special variable .GRP for this purpose. There's also .NGRP which returns the number of groups, which could also be useful.
I'm thinking that one could elevate groupindices to the same status as nrow so that one can write this:
transform(groupdf, groupindices => do_something_with_the_indices)