Generic function to summarize subsets of an object by first splitting by row and then "reducing" by a summary function
function
Useful links