[R-sig-ME] glmmADMB troubles [diagnosed + worked around]

Ross Boylan ross at biostat.ucsf.edu
Thu Mar 28 23:22:35 CET 2013


I stepped through the code and think I found the problem.  Since I'm 
running under emacs/ESS the value of the environment variable SHELL is 
funny:

[context: run_bin does think it's in windows and invokes
  shell(cmd, invisible = TRUE, intern = !verbose)]

The relevant branch of shell() is (note it uses shell as a variable 
inside the function)
     if (missing(shell)) {
         shell <- Sys.getenv("R_SHELL")
         if (!nzchar(shell))
             shell <- Sys.getenv("SHELL")
         if (!nzchar(shell))
             shell <- Sys.getenv("COMSPEC")
R_SHELL is empty
SHELL is  "C:/Program Files/GNU Emacs 24.2/bin/cmdproxy.exe"
I believe that is where the "C:/Program" was coming from in the error 
messages.
COMSPEC is  "C:\\Windows\\system32\\cmd.exe".

I set R_SHELL to the value of COMSPEC and now the command runs.

Ross

P.S. shell() in trun invokes system(), which is why you were seeing it 
in the traceback.

On 3/6/2013 6:37 PM, Ross Boylan wrote:
> On 3/2/2013 3:04 PM, Ben Bolker wrote:
>> On 13-02-28 01:15 PM, Ross Boylan wrote:
>>> On 2/27/2013 8:05 PM, Ben Bolker wrote:
>>>> Ross Boylan <ross at ...> writes:
>>    [snip: not including version without NAs removed, since we already
>> know what the issue is there]
>>
>>>> r <- glmmadmb(sexActs~(1|id), sexpartner[!is.na(sexpartner$sexActs),],
>>>> debug=TRUE)
>>> platform: windows 32
>>> executable name: glmmadmb.exe
>>> bin_loc:
>>> c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32/glmmadmb.exe 
>>>
>>>
>>> using temp directory
>>> C:\Users\rdboylan\AppData\Local\Temp\Rtmpy2JsMY\glmmADMB17085c19f4d
>>> creating temp directory
>>> changed working directory to
>>> C:/Users/rdboylan/AppData/Local/Temp/Rtmpy2JsMY/glmmADMB17085c19f4d
>>> Command line:
>>> "c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32/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
>>    I'm a little bit baffled here.  What happens if you use save.dir to
>> save the input files to a temporary directory and run
>>
>> "c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32/glmmadmb.exe" 
>>
>> -maxfn 500 -maxph 5 -noinit -shess
>>
>> from the command line?
>
>> r <- glmmadmb(sexActs~(1|id), 
>> sexpartner[!is.na(sexpartner$sexActs),], debug=TRUE, 
>> save.dir="I:/LAMOC/Ross/")
> platform: windows 32
> executable name: glmmadmb.exe
> bin_loc: 
> c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32/glmmadmb.exe
> changed working directory to I:/LAMOC/Ross
> Command line: 
> "c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32/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
>
> Then from a Windows Command Prompt (not cygwin)
> H:\> 
> "c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32
> /glmmadmb.exe" -maxfn 500 -maxph 5 -noinit -shess
> Error trying to open data input file glmmadmb.dat
>  Error trying to read in model data
>  This is usual caused by a missing DAT file
> H:\>I:
>
> I:\>cd LAMOC/Ross
>
> I:\LAMOC\Ross> 
> "c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/b
> /windows32/glmmadmb.exe" -maxfn 500 -maxph 5 -noinit -shess
>
> Initial statistics: 1 variables; iteration 0; function evaluation 0; 
> phase 1
> Function value   8.9003579e+04; maximum gradient component mag 
> -5.3609e+02
> Var   Value    Gradient   |Var   Value    Gradient   |Var Value    
> Gradient
>
>   1  0.00000 -5.36095e+02 |
>
>  - final statistics:
> 1 variables; iteration 8; function evaluation 14
> Function value   5.0576e+04; maximum gradient component mag 6.2393e-08
> Exit code = 1;  converg criter   1.0000e-04
> Var   Value    Gradient   |Var   Value    Gradient   |Var Value    
> Gradient
>
>   1 112.5711  6.23928e-08 |
> etc
>
> So it seems to work, provided I start in the save.dir. Note that is 
> the directory that R is running in.
> glmmadmb.exe is still running as I hit send.
>
>>
>>   What is the result of .Platform (and .Platform$OS in particular)
>
>> .Platform
> $OS.type
> [1] "windows"
>
> $file.sep
> [1] "/"
>
> $dynlib.ext
> [1] ".dll"
>
> $GUI
> [1] "RTerm"
>
> $endian
> [1] "little"
>
> $pkgType
> [1] "win.binary"
>
> $path.sep
> [1] ";"
>
> $r_arch
> [1] "i386"
>
> Ross
>
>>
>>   It looks conceivably like R is misdiagnosing your system as *not* 
>> being
>> windows, as that's the only way system() should be running.  Are you
>> running under Cygwin (you say it's installed below) ...  ?
>>
>>> changed working directory to i:/LAMOC/Ross
>>> removed temp directory
>>> C:\Users\rdboylan\AppData\Local\Temp\Rtmpy2JsMY\glmmADMB17085c19f4d
>>>> glmmADMB:::get_bin_loc()
>>> $bin_loc
>>> [1]
>>> "c:/Users/rdboylan/Documents/R/R-2.15.2/site-library/glmmADMB/bin/windows32/glmmadmb.exe" 
>>>
>>>
>>>
>>> $platform
>>> [1] "windows"
>>>
>>> P.S. about lme4; I don't have a build environment and so trying the
>>> github version will not be my first move.
>>> Although perhaps lack of a build environment is why the second version
>>> is failing.  I do have cygwin installed, althoughI would not expect 
>>> R to
>>> know how to find it.
>>    lme4 should be installable from lme4.r-forge.r-project.org/repos now,
>> as stated in a message earlier today.
>>
>



More information about the R-sig-mixed-models mailing list