See how the tidyr R package’s gather and spread functions work. Plus a bonus look at labeling in ggplot2