R file to do the data cleaning