R Assignment 2

change mean to inverse