1

我正在尝试通过 R 运行一个 .bat 文件,其中包含 ASReml 的输入文件。.bat 文件在 Windows cmd 提示符下执行时可以正常工作,但我无法通过 R 使其工作。我使用的代码以前(几个月前)可以工作,但现在它给了我错误。

.bat 文件如下所示:

> batfile.univariate
      [,1]                              
 [1,] "asreml -nw31 1_Yr2WT.as"         
 [2,] "asreml -nw31 2_Yr2Fat.as"        
 [3,] "asreml -nw31 3_Yr3WT.as"         
 [4,] "asreml -nw31 4_Yr3Fat.as"        
 [5,] "asreml -nw31 5_HarvWT.as"        
 [6,] "asreml -nw31 6_FatPC.as"         
 [7,] "asreml -nw31 7_HarvDefCode.as"   
 [8,] "asreml -nw31 8_HarvMatureCode.as"
 [9,] "asreml -nw31 9_HarvSurv.as"      
[10,] "asreml -nw31 10_SRSDTD.as" 

我用来运行 batfile 的代码是这样的:

for (i in batfile.univariate) {shell(i, intern = TRUE)}

错误代码是这样的:

    Warning messages:
1: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  :
  running command 'C:\WINDOWS\system32\cmd.exe /c asreml -nw31 1_Yr2WT.as' had status 1
2: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  :
  running command 'C:\WINDOWS\system32\cmd.exe /c asreml -nw31 2_Yr2Fat.as' had status 1
3: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  :
  running command 'C:\WINDOWS\system32\cmd.exe /c asreml -nw31 3_Yr3WT.as' had status 1
4: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  :
  running command 'C:\WINDOWS\system32\cmd.exe /c asreml -nw31 4_Yr3Fat.as' had status 1
5: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  :
  running command 'C:\WINDOWS\system32\cmd.exe /c asreml -nw31 5_HarvWT.as' had status 1
6: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  :
  running command 'C:\WINDOWS\system32\cmd.exe /c asreml -nw31 6_FatPC.as' had status 1
7: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  :
  running command 'C:\WINDOWS\system32\cmd.exe /c asreml -nw31 7_HarvDefCode.as' had status 1
8: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  :
  running command 'C:\WINDOWS\system32\cmd.exe /c asreml -nw31 8_HarvMatureCode.as' had status 1
9: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  :
  running command 'C:\WINDOWS\system32\cmd.exe /c asreml -nw31 9_HarvSurv.as' had status 1
10: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  :
  running command 'C:\WINDOWS\system32\cmd.exe /c asreml -nw31 10_SRSDTD.as' had status 1

有没有人建议我做错了什么?非常感谢!

4

0 回答 0