R code for edX Analytics Edge homeworks