Added R code and comments for Assignment 2