R Programming, Programming Assignment 2, Week 3