Completed R code for  Reproducible Research  assignment