This is Assigment 2 for R programming