Reshape lets you flexibly restructure and aggregate data using just two functions: melt and cast. WWW: https://cran.r-project.org/web/packages/reshape2/