R script for Project