Regards, Xianming From: Xianming Wei Sent: Tuesday, 3 March 2009 9:22 AM To: 'r-help@r-project.org' Subject: how to pass a command variable in DOS to R program in R CMD BATCH Hi all, I need to run a program (asreml) thousands of times and each time I have to provide a slightly different dataset. Because I have to run asreml under Windows (DOS or scripts) environment, I have trouble to pass a command variable (or pointer variable or %counter in the following example) to R program so at each counter R can generate a different data set for asreml to run. Any suggestion appreciated. @echo off set /a counter=0 :numbers R CMD BATCH generate.data.R [I don't know how I can pass %counter to generate.data.R] asreml asreml.program R CMD BATCH collate.results.R print %counter set /a counter=%counter%+1 if %counter% ==15360 (goto :eof) else (echo %counter% >> C:\count.txt) goto :numbers Regards, Xianming DISCLAIMER:\ For details of our e-mail disclaimer, pleas...{{dropped:24}} ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.