R Code to Accompany Solutions to Homework #12