R Programming Coursera Course Programming Assignment 3