R script for getting tidy_data.txt