library(batch) Allk<-c(1298000)#2124 1298000 seed=300 for(j in 1:length(Allk)){ for(i in 1:12) { seed <- rbatch("IBD_PCa_2956_batch.r",seed=seed,mig=Allk[j]) # add whatever other arguments you want to pass to the AveRes.R function inside the rbatch command } } ~ ~