Code for Cloudera R Programming session 8