r prog assignment2