codes used to the coursera R programming