R homework 2