PavoDive solution for assignment 2 of R Programming Coursera course