Homework for R Programming Assignment2