[R-sig-ME] error message using glmmadmb

Ben Bolker bbolker at gmail.com
Thu Mar 1 17:13:07 CET 2012


  I figured out the problem.

  I almost always use glmmadmb with the data= argument, putting my data
into a data frame rather than having my variables attach()ed (almost
always a bad idea) or floating around in the global workspace.  If you
do this:

mydata <- data.frame(spdiv,nsn,ara,rap,Insect.type,fsize,Site)
glmmadmb(spdiv~(nsn+ara+rap)*Insect.type+fsize+(1|Site),family="nbinom")

it ought to work.  However, it *should* work the way you specified -- I
will work on fixing the bug.

  thanks
    Ben Bolker


On 12-03-01 09:19 AM, RH Gibson, School Biological Sciences wrote:
> Hi Ben - latest attempt below . . .
> 
> 
>> local({pkg <- select.list(sort(.packages(all.available = 
> TRUE)),graphics=TRUE)
> + if(nchar(pkg)) library(pkg, character.only=TRUE)})
> Loading required package: MASS
> Loading required package: R2admb
> 
> Attaching package: 'glmmADMB'
> 
> The following object(s) are masked from 'package:R2admb':
> 
>    stdEr
> 
>> data1<-read.table("F:/work/Gottingen2010/Pollen 
> analysis/beepollenq.txt",header=T)
>> attach(data1)
>>
>>
> m1<-glmmadmb(spdiv~nsn*Insect.type+ara*Insect.type+rap*Insect.type+fsize+(1|Site),family="nbinom")
> 
> Error in eval(expr, envir, enclos) : could not find function "Droplevels"
> In addition: Warning message:
> In is.na(rows) : is.na() applied to non-(list or vector) of type 'NULL'
>> summary(m1)
> Error in summary(m1) : object 'm1' not found
>> list.files(.libPaths(),pattern="glmm",full.names=TRUE)
> [1] "C:/Program Files/R/R-2.14.2/library/glmmADMB"
>>  i1 <- installed.packages()
>> i1[grep("^glmm",rownames(i1)]
> Error: unexpected ']' in "i1[grep("^glmm",rownames(i1)]"
>>   sessionInfo()
> R version 2.14.2 (2012-02-29)
> Platform: i386-pc-mingw32/i386 (32-bit)
> 
> locale:
> [1] LC_COLLATE=English_United Kingdom.1252
> [2] LC_CTYPE=English_United Kingdom.1252
> [3] LC_MONETARY=English_United Kingdom.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United Kingdom.1252
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> other attached packages:
> [1] glmmADMB_0.7.2.6 R2admb_0.7.5     MASS_7.3-17
> 
> loaded via a namespace (and not attached):
> [1] grid_2.14.2    lattice_0.20-0 nlme_3.1-103   tools_2.14.2
>>
> 
> 
> Rachel.
> 
> --On 01 March 2012 08:12 -0500 Ben Bolker <bbolker at gmail.com> wrote:
> 
>> On 12-03-01 04:49 AM, RH Gibson, School Biological Sciences wrote:
>>> Tried this morning on work PC, with latest versions of R and glmmADMB:
>>>
>>>
>>>>
>>> m1<-glmmadmb(spdiv~nsn*Insect.type+ara*Insect.type+rap*Insect.type+fsize
>>> +(1|Site)+offset(log(Total.grains)),family="nbinom")
>>>
>>> Error in eval(expr, envir, enclos) : could not find function
>>> "Droplevels"
>>> In addition: Warning message:
>>> In is.na(rows) : is.na() applied to non-(list or vector) of type 'NULL'
>>>
>>>
>>>> list.files(.libPaths(),pattern="glmm",full.names=TRUE)
>>> [1] "C:/Program Files/R/R-2.14.2/library/glmmADMB"
>>>> i1 <- installed.packages()
>>>> i1[grep("^glmm",rownames(i1),]
>>> Error: unexpected ']' in "i1[grep("^glmm",rownames(i1),]"
>>
>>   extra comma before the final square bracket: try
>>
>> i1[grep("^glmm",rownames(i1)]
>>
>>   The first command at least confirms for me that you only have one copy
>> of glmmADMB installed.  What are the results of
>>
>>   sessionInfo()
>>
>>  when you have glmmADMB installed?
>>
>>   Ben
>>>
>>>
>>>
>>>
>>>
>>> --On 29 February 2012 15:32 -0500 Ben Bolker <bbolker at gmail.com> wrote:
>>>
>>>>> i1[grep("^glmm",rownames(i1)),]
>>>
>>>
>>>
>>> ----------------------
>>> RH Gibson, School Biological Sciences
>>> Rachel.Gibson at bristol.ac.uk
>>
> 
> 
> 
> ----------------------
> RH Gibson, School Biological Sciences
> Rachel.Gibson at bristol.ac.uk




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