R Code for Labs