R Programming Assigment 2 Solution