R file for Programming Assignment2