R Programming - assignment2