The evolution of the reshape packages

As mentioned before, reshape2 was a complete rewrite of the reshape package, based on around 5 years of experience in using and developing the latter. This update also included some trade-offs, as the original reshape tasks were split among multiple packages. Thus, reshape2 now offers a lot less compared to the kind of magic features that were supported by reshape. Just check, for example reshape::cast; especially the margins and add.missing argument!

But as it turns out, even reshape2 offers a lot more than simply melting and casting data frames. The birth of the tidyr package was inspired by this fact: to have a package in the Hadleyverse that supports easy data cleaning and transformation between the long ...

Get Mastering Data Analysis with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.