The official vignette, "Efficient reshaping using data.tables", is the best introduction to this topic.
Many reshaping tasks require moving between long and wide formats: