dplyr ddply tutorial by Markham