Final R Script