An R function that summarizes across all categories in every combination