O'Reilly logo

R Data Analysis Cookbook by Shanthi Viswanathan, Viswa Viswanathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the split-apply-combine strategy with plyr

Many data analysis tasks involve first splitting the data into subsets, applying some operation on each subset, and then combining the results suitably. A common wrinkle in applying this happens to be the numerous possible combinations of input and output object types. The plyr package provides simple functions to apply this pattern while simplifying the specification of the object types through systematic naming of the functions.

A plyr function name has three parts:

  • The first letter represents the input object type
  • The second letter represents the output object type
  • The third to fifth letters are always ply

In the plyr function names, d represents a data frame, l represents a list, and a represents ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required