updated R code for ProgrammingAssignment2
Merge https://github.com/mariasu11/ProgrammingAssignment2