added R code for project assignment