script for the second assignement of the R programming Coursera course