R scripts for our project