assignment 2 of R language