coursera R Programming Assignment2 code