[datatable-help] My real issue with numeric keys: two numeric keys don't seem to unique correctly.

Chris Neff caneff at gmail.com
Tue May 22 19:01:17 CEST 2012


I am saying

is.unsorted(dt)

returns FALSE.  Is that the expected result here? If so then I do not
understand how is.unsorted works. I guess I thought it should work for
data.frames and not just vectors. I see that in setkeyv it is only
used on the vector out of fastorder though so maybe that is my
confusion.

Either way, fastorder does not return the rightly sorted output indices.



On Tue, May 22, 2012 at 12:52 PM, Steve Lianoglou
<mailinglist.honeypot at gmail.com> wrote:
> Hi,
>
> On Tue, May 22, 2012 at 12:31 PM, Chris Neff <caneff at gmail.com> wrote:
>> Okay, I tried the latest dev version that claimed to fix this issue,
>> but it is still there in a different way.  This was one hell of an
>> issue to nail down. An example:
>>
>>> dt=data.table(x=rep(c(1,2), each=10), y=rnorm(20))
>>> setkeyv(dt,c("x","y"))
>>
>> dt is not properly sorted in the y column. This isn't just an issue
>> with your code. If you try is.unsorted (which you use in setkeyv), it
>> returns FALSE, so it thinks it is sorted.
>
> I may be lost, but `is.unsorted` is working as expected here.
>
> For instance:
>
> R> is.unsorted(dt$y[1:10])
> [1] TRUE
>
> But you're saying that returns FALSE for you? I guess we should
> technically set.seed to be sure, but I'm pretty sure we shouldn't have
> to ...
>
> -steve
>
> --
> Steve Lianoglou
> Graduate Student: Computational Systems Biology
>  | Memorial Sloan-Kettering Cancer Center
>  | Weill Medical College of Cornell University
> Contact Info: http://cbio.mskcc.org/~lianos/contact


More information about the datatable-help mailing list