R Programming - programming assignment 1