https://www.udacity.com/course/ud359 exercises in R, rather than Python