R script for cleaning the dataset