Final version of R programming assignment

Revised and final version