R Programming Week 2 programming assignment