[datatable-help] key<- messes with my factors

Matthew Dowle mdowle at mdowle.plus.com
Tue Nov 15 18:41:31 CET 2011


The documentation/error message could be improved (e.g. setkey could warn
when it sees ordered factors) but, currently at least, it's by design.  Once
floating point and raw character are allowed in keys (progress is happening
behind the scenes) hopefully it either goes away, or we could change to
cater for ordered factors (which don't have ordered levels) as it wouldn't
rely on ordered factor levels.

More background here :

http://r.789695.n4.nabble.com/Factors-may-lose-ordered-class-when-used-as-keys-tp3578759p3578759.html

and two workarounds here :

http://r.789695.n4.nabble.com/Behavior-of-setkey-with-factors-tp2319612p2319612.html




--
View this message in context: http://r.789695.n4.nabble.com/key-messes-with-my-factors-tp4058274p4073409.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list