[R-sig-ME] current r-forge version fails R CMD check ... ?

Martin Maechler maechler at stat.math.ethz.ch
Fri Jul 31 10:41:18 CEST 2009

>>>>> "BB" == Ben Bolker <bolker at ufl.edu>
>>>>>     on Thu, 30 Jul 2009 17:30:17 -0400 writes:

    BB> When I use the latest r-forge version of lme4
    BB> (  0.999375-32 ) it seems to fail R CMD check on a tiny
    BB> numerical mismatch of two objects that are supposed
    BB> (??) to be identical (I also
    BB> get a mangled CHOLMOD error message, but I suspect that
    BB> comes from somewhere within Matrix ...)

yes, and those should be gone with the version of Matrix 
(0.999375-30) of two days ago.

    BB> can anyone confirm? 

No.  To the contrary.
I have had a slightly updated version of tests/lmer-1.Rout.save
ready to be committed for a while, but that's only trivial

and below, from your sessionInfo(), it looks like you are using
a current version of R and packages ... 
hmm ...


    BB> can anyone confirm? any ideas for a fix?

    BB> The offending mismatch between ranef(m2) and ranef(m3)
    BB> is very small ...

well; it's interesting that the offending mismatch in the error
message below is between  m0 and m1,  ...

    >> ranef(m2)
    BB> $ff
    BB> (Intercept)          x2
    BB> 1  -0.8896154  0.06947426
    BB> 2   1.9253111 -0.15035662
    BB> 3  -0.1315062  0.01026994
    BB> 4   0.2420718 -0.01890453

    >> ranef(m3)
    BB> $ff
    BB> (Intercept)          x2
    BB> 1  -0.8896130  0.06947407
    BB> 2   1.9253069 -0.15035628
    BB> 3  -0.1315054  0.01026988
    BB> 4   0.2420710 -0.01890446

    BB> (this doesn't affect anything I'm doing directly, but
    BB> I want to build some Windows binaries of a hacked version
    BB> using the CRAN win-builder, and to do that I think it
    BB> needs to pass R CMD check ... for now I am going to
    BB> try commenting out the offending test, but that seems
    BB> like a bad idea in general ...)

yes, "bad idea ..".

BTW: Have you noticed that we (Doug Bates and I, when at the
useR/DSC meetings) have moved the former 'allcoef' branch into a
``regular R-forge package''  called  'lme4a'

But yes, that definitely does not pass 'CMD check at the moment'.

    >> getwd()
    BB> [1] "/home/ben/lib/R/pkgs/lme4/pkg/lme4/tests"

    >> source("lmer-1.R",echo=TRUE)

    BB> ...
    >> D <-  data.frame(y= rnorm(20,10), ff = gl(4,5),
    BB> x1=rnorm(20,3), x2=rnorm(20,7),
    BB> x3=rnorm(20,1))
    >> m0 <- lmer(y ~ (x1 + x2)|ff, data = D)
    >> m1 <- lmer(y ~ x1 + x2|ff  , data = D)

We had added these checks exactly *because* we wanted to be sure
that a slightly different use of formulas would lead to the
identical 'X', 'Z', .... matrices, and L(theta)
so I wonder how your version of lme4 could give different
results here....

    >> m2 <- lmer(y ~ x1 + (x2|ff), data = D)
    >> m3 <- lmer(y ~ (x2|ff) + x1, data = D)
    >> stopifnot(identical(ranef(m0), ranef(m1)),
    BB> +           identical(ranef(m2), ranef(m3)),
    BB> +           inherits(tryCatch(lmer(y ~ x2|ff + x1, data = D) ....
    BB> CHOLMOD error: =*ᶈ1ñ¿@ÀTôoá¶
    BB> Error: identical(ranef(m0), ranef(m1)) is not TRUE
    BB> In addition: Warning message:
    BB> In Ops.factor(ff, x1) : + not meaningful for factors

Note that the cholmod error and warning is from the 
   lmer(y ~ x2|ff + x1, data = D)
part {which is wrapped in  tryCatch(...)}.

Also, if I execute

D <-  data.frame(y= rnorm(20,10), ff = gl(4,5),
                 x1=rnorm(20,3), x2=rnorm(20,7),
m0 <- lmer(y ~ (x1 + x2)|ff, data = D)
m1 <- lmer(y ~ x1 + x2|ff  , data = D)
m2 <- lmer(y ~ x1 + (x2|ff), data = D)
m3 <- lmer(y ~ (x2|ff) + x1, data = D)
stopifnot(identical(ranef(m0), ranef(m1)),
          identical(ranef(m2), ranef(m3)))

many times, I never see a problem.

Are you sure you are not using your already-hacked version of
lme4 ???

Martin Maechler, ETH Zurich

    BB> sessionInfo():

    BB> R version 2.9.1 (2009-06-26)
    BB> i486-pc-linux-gnu

    BB> locale:

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

    BB> other attached packages:
    BB> [1] MASS_7.2-47        lme4_0.999375-32   Matrix_0.999375-29
    BB> lattice_0.17-25

    BB> loaded via a namespace (and not attached):
    BB> [1] grid_2.9.1

    BB> -- 
    BB> Ben Bolker
    BB> Associate professor, Biology Dep't, Univ. of Florida
    BB> bolker at ufl.edu / www.zoology.ufl.edu/bolker
    BB> GPG key: www.zoology.ufl.edu/bolker/benbolker-publickey.asc

    BB> _______________________________________________
    BB> R-sig-mixed-models at r-project.org mailing list
    BB> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

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