R Programming course, assignment 2