R file for Assignment2