R assignment 4