R Week 2 programming assignment