plyr package is a set of tools for a common set of problems. We want to split the big problem into smaller pieces, apply functions, and then combine all the outputs back together. The example we presented using the iris data is one where we applied this strategy. Though it is already possible to perform split-apply-combine operations with base R, such as the split and apply family of functions,
plyr makes things much easier and intuitive with its consistent naming convention, various types of input-output processing, and built-in error recovery and informative messages. In general,
plyr provides a replacement for the
for loop. We do not need to replace the
for loop just because it is slow, but we need to replace it to avoid ...