st.run<-Sys.time() pat<-'mcar' #rate<-c(.1,.2,.4) rate<-.1 for (r in rate){ resfile <- paste(pat ,'-',r,'.txt', sep='') for (i in 1:1){ datafile <-paste('cp ~/Private/bootmedem/mbr/data/',pat,'/','data-', i,'-',r,'.txt data.txt',sep='') system(datafile) system('sas mi.sas') if (file.exists('bcci.txt')){ temp<-scan('bcci.txt') cat(c(i, temp), file=resfile, append=T) cat("\n", file=resfile,append=T) system('rm -f data.txt bcci.txt mi.log mi.lst')} } } run.time<-Sys.time()-st.run run.time