R Programming Assignment 3 from Coursera data Science Track