tidyr has two tools for reshaping data: gather (wide to long) and spread (long to wide).
gather
spread
See Reshaping data for other options.