R Programming Assignment 3 Part 2