plyr

The split-apply-combine strategy for R

plyr is a set of tools for a common set of problems: you need to split up a big data structure into homogeneous pieces, apply a function to each piece and then combine all the results back together. For example, you might want to:

It’s already possible to do this with base R functions (like split and the apply family of functions), but plyr makes it all a bit easier with:

Considerable effort has been put into making plyr fast and memory efficient, and in many cases plyr is as fast as, or faster than, the built-in functions.

If you are interested in the watching the development of plyr, please see the development site on github. If you’ve discovered any bugs in the plyr package, or you have thought of a killer new feature, please email me: h.wickham@gmail.com.

Installation


# Get the released version from CRAN
install.packages("plyr")

# Get the development version from github
devtools::install_github("hadley/plyr")

News

Learning more

The best place to start is the article published in JSS: The Split-Apply-Combine Strategy for Data Analysis.

You might also find the notes from a tutorial I offered at User! 2009 useful.

You are welcome to ask plyr questions on R-help, but if you’d like to participate in a more focussed mailing list, please sign up for the manipulatr mailing list:

Your email address:

You must be a member to post messages, but anyone can read the archived discussions.