The package Reshape2 in R is a very powerful tool to flexibly restructure and aggregate data. For users familiar with the pivot table function in Excel or Libreoffice/Openoffice, this tool offers similar (and more) functionality, albeit from the command line.
It’s flexibility comes with a price, it may not be extremely intuitive for the beginner. That is where the ReshapeGUI by Jason Crowley comes in handy. ReshapeGUI is a GUI for the reshape2 and plyr packages. It is a handy tool for learning how to use the functions from these packages. So if you are daunted by the seemingly complexity of the reshape2 package, check out this R package.