R Programming assignment