Completed assignment 2 for The R programming course on Coursera