R assignment 3