Skip to content

Bug in all.equal() or in the plm package

1 message · Achim Zeileis

#
Hi,

sorry for replying so late to this. I somehow missed the original thread 
and was just pointed to it by Yves...
Well, ?length says:

      The default method currently returns an 'integer' of length 1.
      Since this may change in the future and may differ for other
      methods, programmers should not rely on it.

The problem IMO is that the all.equal() method for "formula" gets called 
by inheritance without assuring that it works. I think we just need to 
supply a suitable all.equal() method for "Formula" objects.
This wouldn't be correct either because this is not a list of length 2. A 
"Formula" is a "formula" (of length 2 or 3) with two attributes ("lhs" and 
"rhs"). Thus, currently length() does not reflect the internal structure 
but rather the conceptual structure (of a formula consiting of a LHS and 
RHS, both with a certain length).

Unless there are good reasons to do otherwise, I would keep the length() 
method and just supply a suitable all.equal() method for 
"Formula" objects.

hth,
Z