R programming - Homework week 1