R programming week 3 assignment