首页 文章

R中的glmmadmb()找不到消息错误'C:/Program'

提问于
浏览
0

使用:

  • Windows 7

  • Emacs 24.3

  • ESS

  • R 3.1.1

来自 glmmadmb() 的错误:

Error in system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait, : 'C:/Program' not found"

提示我在没有空格的路径名中重新安装R,正如这篇关于same error (with Rcpp)的帖子所推荐的那样 . 我这样做了,错误仍然存在 .

Rstudio中的代码在标准/默认R安装(带空格的路径名)中运行时没有错误 . 尝试装入 glmmadmb() 时,我的问题发生在EMACS / ESS / R 3.1.1上,这促使我运行 debug=TRUE

>   gaFP0<-glmmadmb(count~tx,
                    random=~(1|Feed)+(1 | Pint),
                    data=dnoNM,family="nbinom",zeroInflation=TRUE,
                    debug=TRUE)

哪个输出:

platform: windows 64 
executable name: glmmadmb.exe 
bin_loc: C:/RLIB/glmmADMB/bin/windows64/glmmadmb.exe 
using temp directory
C:\Users\user1\AppData\Local\Temp\Rtmpq2AddG\glmmADMB90e434c55ff2 
creating temp directory changed working directory to
C:/Users/user1/AppData/Local/Temp/Rtmpq2AddG/glmmADMB90e434c55ff2 
Command line: "C:/RLIB/glmmADMB/bin/windows64/glmmadmb.exe" -maxfn 500 -maxph 5 -noinit -shess 
Error in system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait,  : 
'C:/Program' not found
 changed working directory to h:/
removed temp directory
C:\Users\user1\AppData\Local\Temp\Rtmpq2AddG\glmmADMB90e434c55ff2

作为注释 - 我还重新安装了Emacs,在路径名中没有空格但仍然有错误,虽然我没有卸载原始版本 .

1 回答

  • 1

    我使用的hack使得EMACS / ESS可以运行代码是函数调用之前的以下 Sys.setenv() 语句 .

    >   Sys.setenv(R_SHELL = "C:\\Windows\\system32\\cmd.exe")
    >   gaFP0<-glmmadmb(count~tx,
                        random=~(1|Feed)+(1 | Pint),
                        data=dnoNM,family="nbinom",zeroInflation=TRUE,
                        debug=TRUE)
    

    现在 glmmadmb() 按预期运行 . 请参阅Ross Boylan解释的原因(此Q&A stackoverflow帖子是在他的许可下写的) .

相关问题