R Programming course Programming Assignment 2