Programming assignment 2 for R Programming course on Coursera.org