R markdown file for data preparation