r prog assignment 2