Search code examples
rnamespaceslme4varcomp

Error : object ‘sigma’ is not exported by 'namespace:lme4'


After updating lme4 (1.1-12), I'm getting this error when I invoke varComp package.

library(varComp)
Error : object ‘sigma’ is not exported by 'namespace:lme4'
Error: package or namespace load failed for ‘varComp’

Edited

Here is my sessionInfo()

sessionInfo()
R version 3.3.0 beta (2016-03-30 r70404)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu 14.04.3 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] lme4_1.1-12     Matrix_1.2-4    devtools_1.11.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.4         Formula_1.2-1       roxygen2_5.0.1.9000 magrittr_1.5        cluster_2.0.3      
 [6] MASS_7.3-45         mutoss_0.1-10       splines_3.3.0       BiocGenerics_0.12.1 mnormt_1.5-4       
[11] xtable_1.8-2        colorspace_1.2-6    lattice_0.20-33     R6_2.1.2            quadprog_1.5-5     
[16] parallel_3.3.0      broom_0.4.0         latticeExtra_0.6-28 coda_0.18-1         TH.data_1.0-7      
[21] withr_1.0.1         MatrixModels_0.4-1  assertthat_0.1      digest_0.6.9        multtest_2.22.0    
[26] acepack_1.3-3.3     StroupGLMM_0.1.0    phia_0.2-1          scales_0.4.0        lsmeans_2.23       
[31] Hmisc_3.17-3        lmerTest_2.0-30     stats4_3.3.0        survey_3.30-3       munsell_0.4.3      
[36] multcomp_1.4-4      minqa_1.2.4         plyr_1.8.3          dplyr_0.4.3.9000    stringr_1.0.0      
[41] car_2.1-2           tools_3.3.0         grid_3.3.0          nnet_7.3-12         pbkrtest_0.4-6     
[46] nlme_3.1-127        Biobase_2.26.0      gtable_0.2.0        mgcv_1.8-12         quantreg_5.21      
[51] psych_1.5.8         plotrix_3.6-1       DBI_0.3.1           survival_2.39-2     gridExtra_2.2.1    
[56] ggplot2_2.1.0       tidyr_0.4.1         nloptr_1.0.4        reshape2_1.4.1      RColorBrewer_1.1-2 
[61] codetools_0.2-14    rpart_4.1-10        aod_1.3             memoise_1.0.0       sandwich_2.3-4     
[66] stringi_1.0-1       estimability_1.1-1  CompQuadForm_1.4.1  mvtnorm_1.0-5       SparseM_1.7        
[71] foreign_0.8-66      zoo_1.7-12      

Solution

  • The varComp package depends on RLRsim. RLRsim uses the S3 generic sigma, which was moved from lme4 to stats in R 3.3.0. If you use a Windows binary for RLRsim built under R < 3.3.0, then RLRsim will look for sigma in lme4 instead on in stats:

    > install.packages("https://cran.r-project.org/bin/windows/contrib/3.2/RLRsim_3.1-2.zip", repos=NULL)
    ...
    package ‘RLRsim’ successfully unpacked and MD5 sums checked
    > library(varComp)
    Error : object ‘sigma’ is not exported by 'namespace:lme4'
    Error: package or namespace load failed for ‘varComp’
    

    If you reinstall RLRsim you should get a recent build and varComp will load:

    > install.packages("RLRsim")
    ...
    package ‘RLRsim’ successfully unpacked and MD5 sums checked
    ...
    > library(varComp)
    >