Programming Assignment2 - R programming