Loop Functions In R Programming