Added R code

R code for peer assigment