R Quiz week 4 and Programming assignment