Stephen at Getting Genetics Done describes using the plyr package in
R to group data together by category variables for summaries:
The PLYR package is a tool for doing split-apply-combine (SAC) procedures. I?m very fluent in SQL so the best
analogy for me was the GROUP BY statement in SQL. PLYR adds very little new functionality to R. What it does do is
take the process of SAC and make it cleaner, more tidy and easier.