r code to read and clean the data