R programing assignment 2