C and R Code for my ecn395 Class