coursera assignment2 of R programming