Updated R file with my code for assignment 2