Contribution to Programming Assignment 2 of Coursera's R Programming