Assignment 2 of JH R Programming coursera - final