Re: [R] "infinite recursion" in when lme4 loaded only

From: Martin Maechler <>
Date: Fri 13 Jan 2006 - 22:24:51 EST

>>>>> "Dieter" == Dieter Menne <> >>>>> on Thu, 12 Jan 2006 18:14:32 +0000 (UTC) writes:

    Dieter> Peter Dalgaard <p.dalgaard <at>> writes:
>> > A larg program which worked with lme4/R about a year ago failed when I
>> > re-run it today. I reproduced the problem with the program below.

>> > -- When lme4 is loaded (but never used), the fails
>> > with infinite recursion after 60 seconds. Memory used increases
>> > beyond bonds in task manager.
>> However, it surely has to do with methods dispatch:
>> > system.time("",caScore))
>> [1] 0.99 0.00 0.99 0.00 0.00
>> which provides you with another workaround.

    Dieter> Peter, I had increased the optional value already, but I still don't understand     Dieter> what this recursion overflow has to do with the lm4 loading.

Aahh, you've hit a secret ;-) no, but a semi-hidden feature: lme4 loads Matrix and Matrix activates versions of rbind() and cbind() which use rbind2/cbind2 which are S4 generics and default methods that are slightly different than then the original base rbind() and cbind().
This was a necessity since the original rbind(), cbind() have first argument "...", i.e. an invalid signature for S4 method dispatch.

This was in NEWS for R 2.2.0 :

    o	Experimental versions of cbind() and rbind() in methods package,
	based on new generic function cbind2(x,y) and rbind2().	 This will
	allow the equivalent of S4 methods for cbind() and rbind() ---
	currently only after an explicit activation call, see ?cbind2.

And 'Matrix' uses the activation call in its .OnLoad hook. This is now getting much too technical to explain for R-help, so if we want to go there, we should move this topic to R-devel, and I'd like to do so, and will be glad if you can provide more details on how exactly you're using rbind.

Martin Maechler,
ETH Zurich mailing list PLEASE do read the posting guide! Received on Fri Jan 13 22:41:00 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:03 EST