How To Repeat A Function In R