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

Steve Lianoglou mailinglist.honeypot at gmail.com
Tue May 22 18:52:06 CEST 2012


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