programing assignment 2 - R programming