Timothy J Clough
2012-Feb-07 21:14 UTC
[R] gmodels error: "no method for coercing this S4 class to a vector"
Dear All, I'm having a problem using functions in the gmodels library on an object of class mer from the lmer package. Code for a reproducible example is below. # Load lme4 library and sample data library(lme4) library(faraway) library(gmodels) data(penicillin) # Fit a linear mixed effects model fit4 <- lmer(yield ~ treat + (1|blend), penicillin) # Extract confidence intervals for fixed effects using gmodels library ci(fit4) The call to 'ci' results in the following error: Error in as.vector(data) : no method for coercing this S4 class to a vector This error does not occur when running the same code on R version 2.13.1. Has anyone else run into this problem? Best regards, Tim Clough ------- Session info below -------> sessionInfo()R version 2.14.1 (2011-12-22) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] gmodels_2.15.1 lme4_0.999375-42 Matrix_1.0-3 lattice_0.20-0 [5] faraway_1.0.5 loaded via a namespace (and not attached): [1] gdata_2.8.2 grid_2.14.1 gtools_2.6.2 MASS_7.3-16 nlme_3.1-103 [6] stats4_2.14.1 tools_2.14.1