Incorrect Function Fix With Command In R