R Programming Assignment 4