[datatable-help] Something seems funky. I think with character-to-factor conversion for keys (?)

Steve Lianoglou mailinglist.honeypot at gmail.com
Tue Mar 8 03:39:59 CET 2011


On Mon, Mar 7, 2011 at 8:50 PM, Matthew Dowle <mdowle at mdowle.plus.com> wrote:
> Btw :
>
>> a small utility at the C level to scan through the levels() of
>> factor-keys to test for them being in order and
>> breaking/short-circuiting as soon as it finds one level that's out of
>> order?
>
> That's base::is.unsorted(), which is done in C.

Aww -- was looking forward to writing some C code ...

It looks like you were right, though -- the problematic data.table has
a (factor) key where `is.unsorted(levels(the_key_column))` is TRUE.

So I guess we're talking about having something like
options(datatable.check.factor.levels=TRUE) check at the top of the
[.data.table function that fires a warning() when the levels are
unsorted, yeah?

-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