full R script generate tidy datasets