added R code file for course project