R programming, Assignment 2