Re: [Rd] R 2.8.0 qqnorm produces error with object of class zoo?

From: Peter Dalgaard <P.Dalgaard_at_biostat.ku.dk>
Date: Wed, 22 Oct 2008 19:26:46 +0200

Gabor Grothendieck wrote:

> On Wed, Oct 22, 2008 at 8:49 AM, Peter Dalgaard
> <P.Dalgaard_at_biostat.ku.dk> wrote:
>   

>> Pfaff, Bernhard Dr. wrote:
>>
>>> It seems, that in my previous emails the attached output files got deleted, hence these are now copied below: >>> >>> >>>

>> (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
>>

>>
>>> dax[3]==dax[6] >>>

>> Data:
>> logical(0)
>>

>> Index:
>> integer(0)
>>

>> and accordingly
>>

>>
>>> rank(dax) >>>

>> 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.
>>
>
> Actually qqnorm does not use rank but it does use order and with the
> xtfrm.zoo method I mentioned qqnorm works with zoo; however, I think
> rank needs to be fixed in R to make use of xtfrm as well since I would have
> expected that supplying an xtfrm method for zoo would be sufficient to
> get both order and rank to work without giving errors.  Also note that rank
> is not generic.
>   

Notice that xtfrm.default() uses rank()....
-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard_at_biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed 22 Oct 2008 - 17:36:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 22 Oct 2008 - 19:31:00 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive