R script producing the tidy data set