[R-sig-ME] Failure to load lme4 on Mac

Martin Maechler maechler at stat.math.ethz.ch
Sat Jul 17 15:12:14 CEST 2010


On Sat, Jul 17, 2010 at 07:30, Ken Knoblauch <ken.knoblauch at inserm.fr> wrote:
> Here is one more thing that I tried, that goes along with
> the hypothesis of interference from some previous initialization.
> I first ran the lmer-1.R file up to the offending section and
> got one result then cleared the workspace and did a gc()
> and then ran just the offending section of code and got
> a different result:
>
>
> ... Previous section of file run ...
>
>> ## Wrong formula gave a seg.fault at times:
>> D <-  data.frame(y= rnorm(20,10), ff = gl(4,5),
>
> +                  x1=rnorm(20,3), x2=rnorm(20,7),
> +                  x3=rnorm(20,1))
>>
>> 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)),
> +           inherits(tryCatch(lmer(y ~ x2|ff + x1, data = D), error =
> function(e)e),
> +                    "error"))
> Error: identical(ranef(m0), ranef(m1)) is not TRUE
> In addition: Warning message:
> In Ops.factor(ff, x1) : + not meaningful for factors
>
> ... then just the next section
>
>> rm(list = ls(all = TRUE))
>> gc()
>
>         used (Mb) gc trigger (Mb) max used (Mb)
> Ncells 906841 24.3    1476915 39.5  1368491 36.6
> Vcells 315369  2.5     905753  7.0   827749  6.4
>>
>> D <-  data.frame(y= rnorm(20,10), ff = gl(4,5),
>
> +                  x1=rnorm(20,3), x2=rnorm(20,7),
> +                  x3=rnorm(20,1))
>>
>> 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)),
> +           inherits(tryCatch(lmer(y ~ x2|ff + x1, data = D), error =
> function(e)e),
> +                    "error"))
> Error: identical(ranef(m2), ranef(m3)) is not TRUE
> In addition: Warning message:
> In Ops.factor(ff, x1) : + not meaningful for factors
>
> Curious.

Well this one is using *different* data  'D' ,
as there's no  set.seed() before its creation..

But in general, may be using the other example (that comes earlier,
and I re-posted here),
it would be very interesting, if you could get it to fail or not to
fail "just depending on the state of your machine / R" (e.g. still in
the same R session)...

>
> Ken




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