How To Create A Function In R