Complete tidy data set fifth question with data.table technique.
This commit requires data.table package.

The grouping with multiple fields and mean on rest of the fields can be done using other melt and dcast as well,
but even in that case we need to import reshape2 package