R programming week 2 - assignment part 2