Completed R file

The completed R file for the Programming Assignment 2