R Programming Homework 2