R file for assignment 2

Leveraged code example to create solution