Coursera R Programming Programming Assignment 3