Solution to RProgramming Assignment 2