R Programming programming assignment 2 - update