Coursera - R programming - Assignment 2