Coursera r prog assignment 1