Programming assignment 2 of the R programming course