Reshape is anR package for flexibly restructuring and aggregating data. It is available on all platforms supported by R (Linux, OS X, Windows, ...). The current version is 0.8.
Reshape (hopefully) makes it easy to do what you have been struggling to do with
summarise. It is also useful for getting your data into the correct structure for lattice or ggplot plots.
Reshape is available from CRAN so you can install it using the following R command:
The best place to start is Reshaping data with the reshape package, published in the journal of statistical software.
You might also be interested in the slides (pdf, 140k) and paper (pdf, 260k) I presented at Directions in Statistical Computing 2005. Please note that after the publication of this paper I changed
melt to avoid a name conflict with base R. An updated version of this paper appeared in the ASA Statistical Computing and Graphics Newsletter (PDF).
You are welcome to ask reshape 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:
You must be a member to post messages, but anyone can read the archived discussions.
Require quicktime to view.
preserve.na renamed to
na.rm to be consistent with other R functions
See the change log for changes in previous versions
Reshape is not a fully fledged OLAP solution. If you need to deal with very large datasets, or want to do complex aggregations or use functions that process data from multiple levels, you should probably use a full OLAP product.
If you've discovered any bugs in the reshape package, or you have thought of a killer new feature, please email me: firstname.lastname@example.org. I'm also always on the look out for interesting data sets that reshape works well (or not so well) on.