Skip to content
Prev 30259 / 63421 Next

R 2.8.0 qqnorm produces error with object of class zoo?

Pfaff, Bernhard Dr. wrote:
(If the MIME type is wrong, then that will happen.)

Anyways, the root cause seems to be the new function .gt() which is
related to

    o   New generic function xtfrm() as an auxiliary helper for
        sort(), order() and rank().  This should return a numeric
        vector that sorts in the same way as its input.  The default
        method supports any class with ==, > and is.na() methods but
        specific methods can be much faster.

        As a side-effect, rank() will now work better on classed
        objects, although possibly rather slowly.

Here, "better" may be in the eyes of the beholder, for
Data:
logical(0)

Index:
integer(0)

and accordingly
Error in if (xi == xj) 0L else if (xi > xj) 1L else -1L :
  argument is of length zero

which is the error that you are seeing.

What to do about it is a bit dubious. Obviously, we don't want to "fix"
.gt() so that it automatically unclasses objects, and I assume that zoo
has its reasons for not wanting to compare series with different
indices. So I suppose that either the user must unclass, or zoo define
rank.zoo.