Code for Assignment 2 of Coursera Course "R Programming"