Course Project R Code