R Intermediate Practice Question 18