[Rd] S4 and Namespaces problems {was "error message from lmer"}

Martin Maechler maechler at stat.math.ethz.ch
Wed Jul 18 17:46:06 CEST 2007

Here is a reproducible example for the Bug that both Sebastian
and Dale Barr found.

As Brian mentioned in an another thread,
the problem is in the interaction of Namespaces and S4 generics
and which S4 generic should keep which methods.

We know there are workarounds, but till now they seem either
ugly or very much against the idea that conceptually there
should be only one generic which may have methods defined in
many different packages / namespaces.

I would like us (R-core, mostly) to resolve this as quickly as


### Do this in a fresh  R session:

summary # S3 generic
find("summary") # base

summary # S4 generic
find("summary") # stats4 , base

## -> loads Matrix (and lattice)
find("summary") # lme4, Matrix, stats4 , base   --- 4 times ! ---

fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
## -->
## Error in lmer(Reaction ~ Days + (Days | Subject), sleepstudy) :
## 	cannot get a slot ("Dim") from an object of type "NULL"

Martin Maechler

>>>>> "BDR" == Prof Brian Ripley <ripley at stats.ox.ac.uk>
>>>>>     on Thu, 28 Jun 2007 06:08:45 +0100 (BST) writes:

    BDR> See the thread starting
    BDR> https://stat.ethz.ch/pipermail/r-devel/2007-June/046157.html
    BDR> https://stat.ethz.ch/pipermail/r-devel/2007-June/046160.html

    BDR> I can't reproduce this without knowing what is in your
    BDR> startup files: it should work with --vanilla, so please
    BDR> try that and try to eliminate whatever is in your
    BDR> .Rprofile etc that is causing the problem.

    BDR> Incidentally, using rcompletion is counterproductive in
    BDR> R 2.5.1 RC: the base functionality using rcompgen is a
    BDR> more sophisticated version.

    BDR> On Wed, 27 Jun 2007, Sebastian P. Luque wrote:

    >> Hi,
    >> I've begun to use the lme4 package, rather than nlme, for more flexibility
    >> during modelling, and running the examples in lmer I receive this error
    >> message:
    >> ---<---------------cut here---------------start-------------->---
    R> (fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
    >> Error in printMer(object) : no slot of name "status" for this object of class "table"
    R> sessionInfo()
    >> R version 2.5.1 RC (2007-06-25 r42057)
    >> x86_64-pc-linux-gnu
    >> locale:
    >> attached base packages:
    >> [1] "stats4"    "stats"     "graphics"  "grDevices" "utils"     "datasets"
    >> [7] "methods"   "base"
    >> other attached packages:
    >> lme4      Matrix rcompletion    rcompgen     lattice    diveMove
    >> "0.99875-2" "0.99875-2"     "0.1-2"    "0.1-13"   "0.15-11"     "0.7-9"
    >> reshape
    >> "0.7.4"
    >> ---<---------------cut here---------------end---------------->---
    >> Since this is happening in a fresh session, and with code from examples
    >> help file, this looks like a potential bug.  Any thoughts?
    >> Cheers,

More information about the R-devel mailing list