summarize function

Summarize each group in a ir object to fewer rows