R Programming assigment week 3