Codes and stuff from coursera R programming assignment 2.