Completion of R Programming Assignment 2