Project 1 R code and plots