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

Steve Lianoglou mailinglist.honeypot at gmail.com
Tue Mar 8 05:08:19 CET 2011


Sorry -- copy/pasting from my R session got screwy:

This:

> The ordering of the "broken" levels is consistent with ordering an integer:
>
> R> head(levels(m2$entrez.id))
> [1] "9"  "10" "12" "13" "18" "20"
>
> And after fixing the data.table, the levels are reorderd as a
> character should be:
>
> R> m2$entrez.id <- factor(as.character(m2$entrez.id))
> [1] "10"        "10009"     "100093630" "10010"     "100113384" "100113407"

The result I pasted above obviously isn't correct, I accidentally
missed a step. It should be:

R> m2$entrez.id <- factor(as.character(m2$entrez.id))
R> head(levels(m2$entrez.id))
[1] "10"        "10009"     "100093630" "10010"     "100113384" "100113407"

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